Library·SOP·Analytics
Add a cookie banner that passes visitors’ choices to Google tags, then check acceptance, refusal and changed preferences.
Last reviewed: · Editorial review
Clarity, structure and references reviewed in this version. This is not a test in a live account.
Add a cookie banner that passes visitors’ choices to Google tags, then check acceptance, refusal and changed preferences.
This SOP covers:
This does not cover:
Record the owner-approved collection mode: basic blocks Google tags until consent; advanced can send cookieless pings while consent is denied. A Denied signal alone does not prove that all requests are blocked. Compare actual behavior with that decision before publishing. See Google’s consent mode behavior. This recipe checks the named European regions; do not assume identical defaults elsewhere. Record any other required regions and test them separately.
A banner collects choices. Consent Mode tells Google tags how to act on those choices; it does not write your privacy policy.
Create a note called Cookie consent setup with sections Website, Owner instructions, and Checks. Enter the website URL, the intended G- Measurement ID supplied by the website owner or tracking installer, and the policy URLs. That ID tells Google where this website’s visits belong. In Owner instructions, enter the supplied business details, services and banner requirements.
In WordPress, open Site Kit > Settings > Connected Services and inspect Analytics. Compare the website’s measurement ID with Website in your note. Inspect Plugins and your Google Tag Manager container, if installed, to identify any existing cookie banner or Consent Mode implementation.
Connect Site Kit to your existing GA4 stream so its consent controls can work. If Analytics is already connected, go directly to its saved settings check below.
If Analytics is not connected, open Site Kit > Settings > Connect More Services > Analytics > Set up Analytics. Sign in with the account that manages the property and allow the requested access. On Connect Service, check the selected account, property and web stream against Website in your note; change them if they point to another site.
For a new connection, keep Enable enhanced measurement off. That option would enable extra automatic visit actions; this guide keeps your existing tracking setup. Click Set up to finish the connection, then open Site Kit > Settings > Connected Services > Analytics > Edit.
Check Place Google Analytics code. Turn it off if Tag Manager or another tool already places the GA4 tag; keep it on if Site Kit places your website’s only GA4 tag. For a new connection, turn Plugin conversion tracking off to avoid adding automatic form or purchase events. Click Confirm changes, then reopen Analytics settings to check the saved choices.
In Checks, add columns Choice, analytics_storage, ad_storage, ad_user_data, and ad_personalization. The first controls Analytics cookies. The other three control advertising cookies, sending user data for advertising, and personalized advertising. Denied and Granted are the states you will check.
Use one manager: Site Kit sends Google consent instructions, WP Consent API carries the choices, and Complianz displays the banner.
In WordPress, open Plugins > Add New Plugin, search for Complianz – GDPR/CCPA Cookie Consent by Complianz, then Install Now > Activate. Choose No, Thanks if an optional Website Scan offer asks for email registration. Open Complianz > Wizard and use Continue to proceed past optional scan or external-service connection offers; the local banner setup does not require those accounts.
Open Site Kit > Settings > Admin Settings. Turn Consent Mode on. If Site Kit shows an Install button for WP Consent API, use it to install and activate the plugin.
Return to Complianz > Wizard. In General, choose the owner-approved region for the opt-in banner and fill in the supplied business contact details. Select the existing privacy and cookie policy pages or enter their approved URLs when the wizard asks.
In Wizard > Consent > Statistics, choose the option matching the tool that places your existing GA4 tag: Yes, and Google Tag Manager fires this script when Tag Manager places it, or Yes, with Google Analytics when Site Kit places it directly. Choose Yes when asked to require consent for statistics. Save and continue.
In Wizard > Consent > Services, answer the advertising, first-party marketing and embedded-service questions from the owner’s website inventory. For a third-party service you use, select it and answer its hosting questions truthfully. Save and continue. The banner may offer Marketing for third-party services even when the site does not run ads.
In Wizard > Consent > Plugins, confirm Google Site Kit is detected. In Statistics configuration, keep Complianz’s own Google Consent Mode V2 option at No; Site Kit provides Consent Mode through WP Consent API. Continue without adding another Analytics tag or signing up for an external cookie-database service.
Configure the public banner and its persistent preference control in Complianz > Consent Banner.
Choose Accept - Deny - View Preferences under Categories. Use the wording and policy links from Owner instructions. Keep Disable banner off, then save.
Set Manage consent display options to Show everywhere, then save. This prevents the plugin’s mobile-hide option from hiding the preference control on smaller screens. On the public website, use Manage consent to reopen the choices after an initial selection.
Complete the remaining wizard questions from Owner instructions. At Finish, set Show consent banner and Enable script and cookie blocker to Yes, then finish setup. Use Continue for an optional external cookie-database connection instead of registering. Clear the site/page cache if the website uses one.
For basic mode, a missing Google destination before acceptance can be expected: confirm blocking through the browser Network and storage panels, then check the consent update after acceptance. For advanced mode, verify defaults before measurement and inspect the effective updates below. In both modes, repeat acceptance, refusal and withdrawal on mobile and after navigation. Record observed requests/cookies as well as consent signals. Site Kit’s consent documentation explains its regional defaults and the WP Consent API integration.
The banner must change Google’s signals, not merely disappear. Test the real published website.
End any existing Tag Manager Preview session. Clear saved site data for this website only in your browser’s site settings, then connect its homepage in Google Tag Assistant. Keep the banner unanswered. Click the intended G- measurement-ID chip along the top, then the website page-title row in the left timeline, then Consent. This page-level view shows the page’s current consent. Record the date and test region in Checks.
Select the earliest Consent event in the left timeline. Under API Call, click the rendered call to expand its fields. Check that analytics_storage, ad_storage, ad_user_data and ad_personalization all default to Denied in the taught regions. Add a Before choice row to Checks. For subsequent choices, return to the page-level Consent view described above: when On-page Update is a dash, its On-page Default value still applies.
On the website, click Accept. Return to the page-level Consent view and read the effective values. Statistics consent grants analytics_storage; the visible Marketing category grants the three advertising signals, even without an Ads tag. If Marketing is absent, those stay Denied. Add an Accept row to Checks. For command details, select the latest Consent event and expand its rendered API Call; that event’s table may show the earlier state.
Open Manage consent on the website. Enable Statistics and turn Marketing off, if present, then Save preferences. Return to the page-level Consent view, read its effective values, and add a Statistics only row to Checks.
Open Manage consent again, refuse Statistics and Marketing, then save or click Deny. Read the effective values in the page-level Consent view and add a Withdraw after accept row to Checks. Reload the page, return to that view, and confirm the refusal is retained.
Disconnect Tag Assistant, clear this website’s saved site data again, and reconnect. Click Deny on the fresh banner. Select the intended G- measurement-ID chip, the website page-title row, then Consent. Read the effective values and add a Deny on first visit row to Checks.
For a denied and an accepted visit, use the intended G- measurement-ID chip, website page-title row and Consent tab to check the Google tag’s current effective values against Checks. In owner-approved advanced mode, a tag may load and send cookieless requests while consent is denied. In basic mode, confirm that Google measurement remains blocked until consent. Evaluate the result against the selected mode. End the session when finished.
Keep the settings and observed choices together so future site changes can be checked.