Google Consent Mode v2: How to Implement It Correctly on Your Website

Google Consent Mode v2: How to Implement It Correctly on Your Website

Peter Gáborík
Published
11 min read
Consent ModeCookiesGoogle Tag Manager
Share this article:Add on Google

Google Consent Mode v2 is the mechanism a website uses to tell Google Analytics and Google Ads whether a visitor accepted analytics and advertising cookies in the cookie banner. Version 2 added two new signals, ad_user_data and ad_personalization. If you target visitors in the EU and want to keep using remarketing, personalised ads and conversion measurement, consent mode has to run on every page and your cookie banner has to pass the visitor's choice to it.

In brief:

  • Consent mode does not replace a cookie banner. The banner collects consent; consent mode passes it to Google's tags.
  • Version 2 has four main signals: ad_storage, analytics_storage, ad_user_data and ad_personalization.
  • The easiest route is a Google-certified consent management platform (CMP) and its Google Tag Manager template.
  • Basic implementation sends nothing without consent; advanced sends anonymous pings and allows more accurate modelling.
  • Check that it works in Tag Assistant, in Google Analytics (Consent settings) and in Google Ads conversion diagnostics.

Consent mode is a feature of the Google tag (gtag.js) and Google Tag Manager. On every page load the site sets a default consent state, usually "denied", and once the visitor clicks in the cookie banner it sends an updated state. Google Analytics and Google Ads tags adjust automatically: without consent they do not store cookies or use data for ad personalisation.

Keep two things apart. Whether you may use analytics and advertising cookies at all is a legal question (in the EU, prior consent; see GDPR and personal data protection). Consent mode is only the technical channel that carries the visitor's decision to Google. It cannot fix a non-compliant banner, and a banner without consent mode blocks cookies but leaves Google with no confirmation of consent.

According to Google's developer documentation, consent mode was updated in November 2023 with two additional parameters. Together with the original two, they form the four signals measurement and advertising rely on:

SignalControlsWhen "denied"
ad_storageadvertising cookiesGoogle Ads does not store or read advertising cookies
analytics_storageanalytics cookiesGoogle Analytics stores no cookies and sends only cookieless pings (advanced implementation)
ad_user_data (new)sending user data to Google for advertisingpersonal data collection for advertising is disabled, including user_id and hashed data for enhanced conversions
ad_personalization (new)personalised advertisingpersonalisation is disabled and remarketing receives no data

There are also supplementary types, functionality_storage, personalization_storage and security_storage, for functional, personalisation and security storage. Google Ads and Analytics rely mainly on the four signals in the table.

Google has strengthened enforcement of its EU user consent policy for traffic from the European Economic Area. To keep using Google's tags and SDKs for measurement, ad personalisation and remarketing with EEA visitors, you must collect consent and pass it to Google through consent mode. This also covers Google Analytics data used in Google Ads.

What that means in practice:

  • Banner and consent mode in place, no personalised ads: according to Google, no action is needed.
  • Consent mode in place, using remarketing or personalisation: Google-certified CMPs updated to the new version automatically; with a custom banner you must add ad_user_data and ad_personalization yourself.
  • Banner without consent mode: enable it in the banner settings or implement it manually.
  • No banner: set up a banner first, move legacy tags to gtag.js or GTM, then add consent mode.

Even if your site only runs Google Analytics and no ads, we recommend consent mode. Without it, Analytics does not see visitors who decline consent at all and cannot model them.

Basic vs advanced implementation

There are two ways to implement consent mode. The difference is what happens before the visitor clicks in the banner:

BasicAdvanced
Google tags loadonly after interaction with the banneras soon as the page opens, with default "denied"
Data without consentnothing, not even the consent statecookieless pings (no identifiers)
Data with consentfull measurementfull measurement
Modellinggeneral modeladvertiser-specific model, more detailed

Basic implementation is the more cautious option and easier to defend, but data from people who decline is missing entirely. Advanced sends only anonymous cookieless signals when consent is denied, and Google uses them to estimate missing conversions and traffic. The choice is both a business and a legal one: discuss it with your lawyer or data protection officer, especially if you follow a strict reading of the cookie rules.

For most business websites and online stores this is the fastest and safest route:

  1. 1Choose a Google-certified CMP. Certified providers support consent mode v2 and handle updates for you.
  2. 2Set up consent categories in the banner (necessary, analytics, marketing) and map them to ad_storage, analytics_storage, ad_user_data and ad_personalization.
  3. 3Add the banner's template in GTM from the Community Template Gallery and fire it with the Consent Initialization – All Pages trigger. It runs before every other trigger, so the default consent state is set before any tag loads.
  4. 4Enable the consent overview in Admin > Container Settings (Enable consent overview) and review consent settings for every tag. Google tags have Built-In Consent Checks; for third-party tags such as the Meta pixel, set Require additional consent for tag to fire with the relevant consent type.
  5. 5Remove duplicate code pasted directly into the site template, so that Google Analytics or conversion tags do not fire outside GTM and outside consent.
  6. 6Test in GTM preview mode and publish the version.

Option B: a custom banner and gtag.js

With a custom banner you need three steps on every page, in this exact order:

  1. 1Default state with gtag('consent', 'default', …), all four signals set to denied, placed before the Google tag loads. Google states explicitly that defaults will not work if the code runs out of order.
  2. 2Optionally wait_for_update (in milliseconds; the documentation uses 500 as an example) so the banner has time to load a saved choice before data is sent. The region parameter lets you set different defaults for different countries.
  3. 3Update with gtag('consent', 'update', …) as soon as the visitor clicks in the banner, and on every later page load based on the choice stored in a first-party cookie or localStorage. Withdrawing consent is another update with the value denied.

You can also enable ads_data_redaction (removes ad click identifiers from requests when ad_storage is denied) and url_passthrough (passes click identifiers in URLs between pages so conversions can be measured without cookies). A custom setup needs a developer and careful testing, so for a typical website a certified CMP makes more sense.

  • Tag Assistant and GTM preview: open the site in preview, do not choose anything in the banner and check that the default state is denied. Clicking Accept must send an update to granted; clicking Reject must leave it denied.
  • Browser: in a private window, open developer tools (F12) and check that no cookies starting with _ga, _gcl or _fbp are stored before consent.
  • Google Analytics: in Admin, under Data collection and modification, open Consent settings. You will see the share of EEA traffic and conversions and the status of advertising and analytics signals for each data stream. According to Google Analytics Help, notifications update 48–72 hours after a fix.
  • Google Ads: consent mode status is shown in conversion diagnostics for each conversion action.

Without consent you lose part of your data, and Google can estimate some of it. According to Google's help centre, behavioural modelling in Google Analytics 4 requires:

  • consent mode on all pages and an advanced implementation (tags load even without consent),
  • at least 1,000 events per day with analytics_storage denied for at least 7 days,
  • at least 1,000 daily users with consent granted for at least 7 of the previous 28 days.

Modelled data appears after you switch the reporting identity to Blended in Admin. Meeting the thresholds does not guarantee a model, and modelling does not apply to features such as audiences or BigQuery export. For a smaller business website this means you will often not see modelled data in GA4, but you still need consent mode for remarketing and Google Ads measurement.

Most common implementation mistakes

  • The default state is set too late, for example after the Google tag has loaded, so the first requests go out without consent information.
  • The banner sets only ad_storage and analytics_storage. Without ad_user_data and ad_personalization you lose remarketing and personalisation for EEA visitors.
  • Google Analytics is on the site twice, once in the template and once in GTM, and one of them ignores consent.
  • The Meta pixel or other third-party tags run without consent. Consent mode only controls Google's tags; others must be blocked in GTM.
  • The choice is not stored, so the next page resets to denied and you lose data even from people who consented.
  • The Reject button is hidden or less prominent. That is a cookie banner issue rather than a consent mode one, but it can make the whole setup non-compliant.

When to hand it over to a specialist

If your site has a single Google Analytics tag and a certified banner, you can implement consent mode with the steps above in an afternoon. Bring in a specialist when you advertise on Google Ads and Meta, use remarketing, enhanced conversions or a custom banner, or when the numbers in Google Ads and Analytics do not match. A broken consent setup does not show up as an error on the website; it shows up as a silent loss of data and weaker campaign results.

At Weboptim we implement consent mode as part of PPC campaign management and GTM measurement, and we keep an eye on it in website maintenance so that site changes do not break it. For related topics, see our guides to Google Analytics 4 and remarketing.

Frequently asked questions

What is Google Consent Mode v2?
Google Consent Mode v2 is the version of Google's consent mode that passes ad_user_data and ad_personalization in addition to ad_storage and analytics_storage. With these signals a website tells Google whether the visitor agreed to advertising and analytics cookies, to sending data for advertising and to personalised ads.
Is Consent Mode v2 mandatory?
No law prescribes it; Google requires it. To use Google's tags for measurement, ad personalisation and remarketing with EEA visitors, its EU user consent policy requires you to collect consent and pass it to Google through consent mode. Without it you mainly lose remarketing and part of your Google Ads data.
What is the difference between basic and advanced consent mode?
With basic implementation, Google tags load only after the visitor clicks in the cookie banner and nothing is sent without consent. With advanced, tags load immediately with a denied default and send only cookieless pings without consent, which Google uses to model missing data more accurately.
Does consent mode replace a cookie banner?
No. The cookie banner collects consent and consent mode passes it to Google's tags. You need both, and the banner must follow the rules, for example making rejecting as easy as accepting and using no pre-ticked boxes.
How do I know Consent Mode v2 is set up correctly?
The quickest check is Tag Assistant or GTM preview: before a choice in the banner all four signals must be denied, and granted after acceptance. Then check Consent settings in Google Analytics Admin and conversion diagnostics in Google Ads. Analytics notifications update 48–72 hours after a fix.
Does consent mode cover the Meta pixel?
No, consent mode only controls Google's tags. The Meta pixel and other third-party tags have to be blocked according to consent, for example with consent settings in Google Tag Manager.
Peter Gáborík

Written by

Peter Gáborík

Project Manager – AI, Automation & SEO

Project manager and founder of Weboptim. Builds growth strategies around SEO, automation and AI; in online marketing since 2017.

Tips that save time – once a month

One e-mail a month: a new guide, the automation of the month and one number from practice. No spam.