Free download
Set up Google consent mode v2 with a consent banner in Google Tag Manager
Connect a cookie consent banner to Google Tag Manager, set default consent states for UK and EEA visitors, and prove that Google tags respect each visitor's choice.
We reply within one working day. No pitch, no pressure.
- Time
- 90 minutes
- Difficulty
- Intermediate
- Audience
- Marketers and developers with GTM publish access and authority to change the website's cookie banner
Tools: Google Tag Manager · Tag Assistant · A consent management platform (CMP)
Free download. No account needed. Resources licence. Branded PDF in the Wright Websites design system. Covered by the resources licence.
01 / Procedure
How to follow it
Purpose
Visitors in the UK and European Economic Area (EEA) must agree before non-essential cookies are set, and Google requires consent signals before it will use their data for advertising measurement and personalisation. This procedure connects a consent banner to Google Tag Manager (GTM) so that Google tags start in a denied state and update the moment a visitor makes a choice. It is finished when Tag Assistant shows the correct default and updated consent states for an accept, a reject and a returning visitor.
Scope
In scope
- Choosing a consent management platform (CMP) that supports Google consent mode v2
- Setting default consent states for all four consent types
- Updating consent when the visitor chooses, and on return visits
- Checking that Google tags behave correctly in each state
Out of scope
- Writing the cookie policy or deciding the lawful basis (this is a legal decision for the business)
- Consent for non-Google tags beyond enabling GTM's built-in consent checks
- Server-side tagging
Roles and responsibilities
| Role | Responsibility |
|---|---|
| Implementer | Installs the CMP, configures GTM and tests every consent state. |
| Business owner | Approves the banner wording and the list of cookies and vendors. |
| Reviewer | Repeats the accept and reject tests before the container is published. |
Prerequisites
- GTM installed on every page (WW-001) with publish access.
- A current list of the tags in the container and what each one is used for.
- A CMP account, or a decision on which CMP to use. Google publishes a list of certified CMPs.
- The approved cookie policy URL to link from the banner.
Procedure
Understand the four consent types
Consent mode v2 uses four signals. Every Google tag reads them before deciding what to store or send.
-
Record these four consent types in the work ticket, with what each controls:
ad_storage: cookies used for advertising.analytics_storage: cookies used for analytics, such as GA4.ad_user_data: whether user data can be sent to Google for advertising.ad_personalization: whether data can be used for personalised advertising and remarketing.
-
Agree the mode with the business owner: advanced (tags load before consent and send cookieless pings when denied) or basic (tags are blocked entirely until the visitor accepts).
[!NOTE] Advanced mode lets Google model some lost conversions. Basic mode sends nothing before consent. Both are valid; the business decides which matches its policy.
Install the consent banner through GTM
Load the banner before any other tag.
-
In GTM, open Admin, then Container Settings, and tick Enable consent overview. Save.
-
Open Templates, search the Community Template Gallery for the chosen CMP's official template, and add it to the workspace.
-
Create a tag from that template. Enter the CMP account or site ID, and attach the built-in trigger Consent Initialization - All Pages.
-
In the template's default consent settings, set all four consent types to
deniedfor the region list covering the UK and EEA countries. Set the default for other regions according to the business's policy. -
Make sure the template's option to update consent when the visitor chooses is switched on, and that the choice is stored so returning visitors are not asked again.
[!WARNING] Never set defaults to
grantedfor UK or EEA visitors. Tags would set advertising and analytics cookies before the visitor has agreed.
Configure tag consent checks
Make every tag in the container declare what it needs.
- Open Tags and click the shield icon to open the consent overview.
- Confirm Google tags (GA4, Google Ads, Conversion Linker) show Built-in consent checks. Do not add extra consent requirements to them.
- For each non-Google tag that sets cookies, select it and choose Require additional consent for tag to fire, then add the matching consent type, such as
ad_storagefor an advertising pixel. - Save and click Preview.
Test every consent state
Prove the container behaves correctly for each choice.
- In Tag Assistant, load the site in a private window. On the first event, open the Consent tab and confirm all four types show Denied as the default.
- Click Reject all on the banner. Confirm the consent state stays denied, and that non-Google tags requiring consent did not fire.
- Clear the site's cookies, reload, and click Accept all. Confirm an Update row shows all four types as Granted, and that GA4 and Google Ads tags now fire normally.
- Reload the page without clearing cookies. Confirm the banner does not reappear and the stored choice is applied as the default.
- Click Submit, name the version
Consent mode v2, and publish.
Quality checks
- The consent banner tag uses the Consent Initialization - All Pages trigger.
- All four consent types default to
deniedfor UK and EEA visitors. - Accepting updates all four types to
granted; rejecting leaves them denied. - Non-Google cookie-setting tags require the matching consent type.
- Returning visitors are not shown the banner again and their choice is applied.
- The banner links to the approved cookie policy.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Consent tab shows no default | Banner tag on All Pages instead of Consent Initialization | Move the banner tag to the Consent Initialization - All Pages trigger. |
| Google Ads warns consent signals are missing | ad_user_data or ad_personalization not set | Update the CMP template to send all four v2 consent types. |
| Tags fire before the visitor chooses | Defaults set to granted, or a hard-coded tag outside GTM | Set denied defaults and move hard-coded tags into GTM. |
| Banner shows on every page | Choice not stored, or cookies blocked on a subdomain | Check the CMP storage settings and cookie domain. |
| GA4 traffic drops sharply after launch | Basic mode chosen, or many visitors rejecting | Confirm the agreed mode; expect lower observed numbers in basic mode. |
Records
- Record the CMP, the mode (basic or advanced), the default settings by region and the GTM version in the client's tracking plan.
- Save Tag Assistant screenshots of the default, accept and reject states with the work ticket for at least two years.
References
Related procedures
- Install Google Tag Manager on a websiteWW-001
Create a Google Tag Manager container, install it on every page of a website exactly once, and prove it loads before any tags are added.
- Set up Google Analytics 4 and deploy it through Google Tag ManagerWW-002
Create a correctly configured GA4 property and web data stream, deploy the Google tag through Google Tag Manager, and confirm real visits are recorded.
- Set up Google Ads lead conversion tracking with Google Tag ManagerWW-013
Create a Google Ads conversion action for leads, deploy the Conversion Linker and conversion tags through Google Tag Manager, and confirm conversions are recorded.