Google Consent Mode & analytics
Google Consent Mode v2 explained
Consent Mode v2 is how your cookie banner tells Google's tags what each visitor agreed to. It added two advertising signals in late 2023, and since March 2024 Google has required it for EEA traffic if you want to keep using its measurement and personalization features.
- Plain English
- Written for website owners
- Free to read
On this page
Google Consent Mode is a set of signals your website sends to Google's tags, such as Google Analytics 4, Google Ads and Floodlight, to say what the visitor has consented to. The tags then adjust what they store and send. Version 2, introduced in late 2023, added two signals about advertising use of personal data. Since March 2024, Google has required these signals for visitors in the European Economic Area if you want to keep using features like remarketing and conversion measurement for that traffic. Consent Mode doesn't ask visitors anything. Your cookie banner does that, and passes the answer on.
The signals
Consent Mode uses named consent types, each set to granted or denied. Four are the core signals that Google's own advertising and analytics tags act on:
| Signal | What it controls | Added in |
|---|---|---|
ad_storage | Cookies and other storage used for advertising | v1 |
analytics_storage | Cookies and other storage used for analytics | v1 |
ad_user_data | Whether user data may be sent to Google for advertising | v2 |
ad_personalization | Whether data may be used for personalized advertising, such as remarketing | v2 |
Three further types, functionality_storage, personalization_storage and security_storage, exist mainly for Google Tag Manager users who want to gate their own tags on them. Google's tags don't change their behavior based on these.
The v2 signals separate two questions that v1 merged. ad_storage is about storing data on the device. ad_user_data and ad_personalization are about what Google may do with data it receives, such as using conversions for audience lists. A visitor who rejects marketing should get all three advertising signals denied.
Why v2 became required in the EEA
In September 2023, the European Commission designated Alphabet as a gatekeeper under the Digital Markets Act, with obligations applying from March 2024. Among other things, the DMA requires gatekeepers to obtain consent before combining personal data across their services, including data from third-party sites that use their advertising tools.
Google responded by updating how it enforces its EU user consent policy. Advertisers and publishers sending EEA traffic to Google need to collect consent and pass it to Google, and Consent Mode v2 is the main way to do that for websites. Google has said that, without consent signals, features such as building remarketing audiences and some conversion measurement may be limited for EEA users.
Google applies its EU user consent policy to the UK too, and extended it to Switzerland in 2024. Requirements differ slightly by product and region, and Google updates them, so check Google's current policy pages for the products you use. The guide to Google's EU user consent policy covers the advertiser side in more detail.
Default and update: how the signals are sent
Consent Mode works through two commands in the gtag() API, which pushes them to window.dataLayer.
Default
The default command sets the starting state before any Google tag runs. It must come first on the page, above your Google tag or Tag Manager snippet:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});
</script>
wait_for_update tells Google tags to wait up to that many milliseconds for an update before sending anything. It's useful when your banner script loads asynchronously and needs a moment to read a returning visitor's stored choice.
Update
When the visitor makes a choice, the banner sends an update with the new values:
gtag('consent', 'update', {
ad_storage: 'granted',
ad_user_data: 'granted',
ad_personalization: 'granted',
analytics_storage: 'granted'
});
A returning visitor's stored choice should also be sent as early as possible on each page, either as the default or as an immediate update, so tags don't start in the wrong state.
Region-specific defaults
The default command accepts a region parameter with ISO 3166 country or subdivision codes. A more specific default overrides a general one. This example denies by default in the EEA, the UK and Switzerland and leaves a separate default for everyone else:
gtag('consent', 'default', {
ad_storage: 'denied', ad_user_data: 'denied',
ad_personalization: 'denied', analytics_storage: 'denied',
region: ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT',
'LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE',
'IS','LI','NO','GB','CH'],
wait_for_update: 500
});
gtag('consent', 'default', {
ad_storage: 'granted', ad_user_data: 'granted',
ad_personalization: 'granted', analytics_storage: 'granted'
});
Granting by default anywhere is a legal decision, not a technical one. Several US states give opt-out rights, Canada's and Brazil's rules lean toward consent, and some sites deny by default everywhere. If your consent tool already decides by region, let it send the right default instead of hard-coding country lists.
Two optional settings
Google offers two settings that change what happens while ad_storage is denied:
gtag('set', 'ads_data_redaction', true);removes ad click identifiers from requests while ad storage is denied.gtag('set', 'url_passthrough', true);carries ad click information, such asgclid, in internal link URLs so it isn't lost when cookies can't be used. It adds parameters to your URLs, so test it with your routing and caching.
Both run before consent, so they belong in the same review as the rest of your consent setup.
Basic and advanced implementations
Google describes two ways to implement Consent Mode:
- Basic: Google tags don't load until the visitor consents. Nothing is sent to Google before that.
- Advanced: Google tags load straight away with consent denied, and send cookieless pings that Google uses for modeling.
The choice affects how much data you recover through modeling, and how comfortable you are with data reaching Google before consent. The comparison of basic and advanced Consent Mode covers the trade-offs.
Consent Mode with Google Tag Manager
In Tag Manager, Google tags have built-in consent checks and read the signals automatically. Non-Google tags, such as Meta, LinkedIn or Hotjar, don't. You need to add an additional consent check to each, for example ad_storage for advertising tags. The consent default must be set before the container's tags run, either by your consent tool or by a tag on the Consent Initialization trigger. The guide to consent in Google Tag Manager walks through the container settings.
How to check it's working
- Open your site in a private window and type
dataLayerin the browser console. The firstconsententry should be adefaultwith the values you expect for your location. - Click a banner button and check that a
consentupdatefollows with the new values. - Use Tag Assistant's preview mode. Its Consent tab shows the default and updated state at each event.
- Check the network requests to Google. The
gcsparameter encodesad_storageandanalytics_storage:G100means both denied,G111both granted. A separategcdparameter encodes the v2 signals. - In Google Ads and GA4, look for consent status diagnostics, which report whether consent signals are being received.
Most broken setups have the same cause: the default is set after a Google tag has already fired. Put the default first, above every Google snippet.
Common mistakes
- Only sending the v1 signals. Sending
ad_storagewithoutad_user_dataandad_personalizationleaves the v2 signals unset, so Google may not have the consent it needs for features such as audience building for EEA visitors. - Granting everything on page load. Some setups send
grantedbefore the visitor chooses. That defeats the purpose and misrepresents consent to Google. - No update for returning visitors. If the stored choice isn't sent on each page, tags run in the default state on every visit.
- Two sources of consent commands. A theme or plugin that sends its own Consent Mode default, alongside your consent tool, can overwrite the visitor's real choice. Search your templates and container for other
gtag('consent'calls and keep one source. - Granting analytics because the data is "anonymous". GA4 sets cookies with a client identifier. Where the law requires consent for analytics cookies,
analytics_storagemust start as denied, whatever GA4 does with IP addresses. - Ignoring opt-out regions. In US states with opt-out rights, a visitor who opts out of sale or sharing, or whose browser sends Global Privacy Control, should have the advertising signals set to denied. Otherwise Google tags keep using their data for ads.
- Forgetting non-Google tags. Consent Mode doesn't stop a Meta Pixel or a heatmap script. Those need blocking or tag manager consent checks.
Once it's set up, check that Consent Mode is working and read how GA4 models the missing data.
Next steps
- Confirm your banner sends all four core signals, with the default set before any Google tag.
- Map your banner categories to signals: analytics to
analytics_storage, marketing to the three advertising signals. - Decide on basic or advanced implementation with your legal adviser.
- Add consent checks to non-Google tags in Tag Manager.
- Test in a private window and with Tag Assistant after every tag change.
- Review your Analytics property settings as well; the GA4 and GDPR guide lists the ones that matter.
PrivacyQuick sends the default and update commands for you, with a denied default before anything else. The Consent Mode setup docs show how its categories map to the signals.
Frequently asked questions
Is Google Consent Mode a cookie banner?
No. Consent Mode is an API that Google tags read. You still need a banner or consent management platform to ask visitors and to send the signals.
Do I need Consent Mode v2 if I don't use Google Ads?
If you only use Google Analytics, Consent Mode is optional, but it is still the standard way to tell GA4 whether it may set cookies. It matters most if you use Google Ads, Floodlight or audience features for EEA, UK or Swiss visitors.
Does Consent Mode v2 apply to US visitors?
Google's consent requirements focus on the EEA, the UK and Switzerland. You can still use Consent Mode to pass US opt-out choices to Google tags, which helps you honor Do Not Sell or Share requests and Global Privacy Control.
What happens if I don't implement Consent Mode v2?
For EEA traffic, Google says features such as remarketing audiences and some conversion measurement depend on receiving consent signals. Without them, those features may be limited for that traffic.
Check your own website in 30 seconds
Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.
This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.