Skip to main content

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.

Tracking & AnalyticsFreePDFWW-016 · v1.0
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)

Download free PDF

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

RoleResponsibility
ImplementerInstalls the CMP, configures GTM and tests every consent state.
Business ownerApproves the banner wording and the list of cookies and vendors.
ReviewerRepeats 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.

  1. 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.
  2. 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.

  1. In GTM, open Admin, then Container Settings, and tick Enable consent overview. Save.

  2. Open Templates, search the Community Template Gallery for the chosen CMP's official template, and add it to the workspace.

  3. Create a tag from that template. Enter the CMP account or site ID, and attach the built-in trigger Consent Initialization - All Pages.

  4. In the template's default consent settings, set all four consent types to denied for the region list covering the UK and EEA countries. Set the default for other regions according to the business's policy.

  5. 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 granted for 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.

  1. Open Tags and click the shield icon to open the consent overview.
  2. Confirm Google tags (GA4, Google Ads, Conversion Linker) show Built-in consent checks. Do not add extra consent requirements to them.
  3. 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_storage for an advertising pixel.
  4. Save and click Preview.

Test every consent state

Prove the container behaves correctly for each choice.

  1. 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.
  2. Click Reject all on the banner. Confirm the consent state stays denied, and that non-Google tags requiring consent did not fire.
  3. 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.
  4. Reload the page without clearing cookies. Confirm the banner does not reappear and the stored choice is applied as the default.
  5. 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 denied for 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

SymptomLikely causeFix
Consent tab shows no defaultBanner tag on All Pages instead of Consent InitializationMove the banner tag to the Consent Initialization - All Pages trigger.
Google Ads warns consent signals are missingad_user_data or ad_personalization not setUpdate the CMP template to send all four v2 consent types.
Tags fire before the visitor choosesDefaults set to granted, or a hard-coded tag outside GTMSet denied defaults and move hard-coded tags into GTM.
Banner shows on every pageChoice not stored, or cookies blocked on a subdomainCheck the CMP storage settings and cookie domain.
GA4 traffic drops sharply after launchBasic mode chosen, or many visitors rejectingConfirm 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