In short
Consent Mode v2 is the Google protocol through which your cookie banner tells Google tags what the visitor has agreed to. It relies on four signals, set to “denied” before the tags load, then updated once the visitor has chosen. Once this check is done, every request sent to Google Analytics 4 or Google Ads carries the actual consent state. This is a measurement task: it has no effect on rankings.
Why it matters
Consent Mode does not display any banner. It passes on to Google tags the choice recorded by your banner or your CMP (Consent Management Platform), and the tags adjust their behavior accordingly.
Four signals carry that choice. The last two were added in November 2023: that is what “v2” refers to.
| Signal | What it allows |
|---|---|
ad_storage |
Reading and writing advertising cookies |
analytics_storage |
Reading and writing analytics cookies (_ga) |
ad_user_data |
Sending user data to Google for advertising purposes |
ad_personalization |
Personalizing ads, including remarketing |
Google's EU user consent policy requires you to obtain consent from visitors in the European Economic Area (EEA), the United Kingdom and Switzerland for cookies and for ad personalization. For that traffic, Google asks advertisers to pass this consent on to it in order to use measurement, personalization and remarketing. If the consent state does not reach Google, it cannot verify the visitor's choice, which can lead to data loss, its documentation warns.
There are two implementations:
| Basic mode | Advanced mode | |
|---|---|---|
| Tag loading | Blocked until the visitor chooses | As soon as the page opens, with a default state of denied |
| If consent is denied | Nothing is sent to Google, not even the consent state | Cookieless signals (“pings”) are sent |
| Modeling | General model | Advertiser-specific model, more detailed |
Advanced mode sends requests to Google before any consent is given: this choice is as much a legal matter as a technical one. The banner, the rules of the CNIL (the French data protection authority) and this trade-off are covered in handle applicable consent requirements (opens in a new tab); this guide only covers wiring up the signals.
Warning: Consent Mode is not GDPR compliance. It passes on a choice; it does not collect it, does not prove it and does not block any third-party script (Meta pixel, heatmap, video player).
What it improves
- Conversion measurement Google Ads models the conversions of visitors who decline cookies from the journeys of those who accept. Google sets a threshold of 700 ad clicks over 7 days, per country and domain grouping.
- GA4 reports Behavioral modeling fills in part of the unmeasured visits. It requires advanced mode, at least 1,000 events per day with
analytics_storagedenied for 7 days, and at least 1,000 daily users with consent granted on 7 of the last 28 days. - Audiences and remarketing When
ad_personalizationis denied, Google Ads remarketing receives no data. The signal must therefore be sent as “granted” as soon as the visitor accepts. - Rankings and citations in AI answers No effect. Neither Googlebot nor generative engines read these signals.
How to check
Tag Assistant. Open Tag Assistant, enter the site's address and let the tab load.
- In the summary, select the first “Consent” event. The
Consenttab should show all four signals asDeniedin the “On-page Default” column. - Accept in the banner, then select the last “Consent” event: the “On-page Update” column reflects your choice.
- Do it again, this time declining.
An empty Consent tab means Consent Mode is not in place on the page.
Network requests. In the developer tools, Network tab, filter on collect and open a request to Google Analytics. Two parameters carry consent: gcs conveys the state of ad_storage and analytics_storage; gcd encodes the detail of the four signals and is always sent, whether Consent Mode is active or not. The value of gcs should change between declining and accepting.
Good to know: Google does not publish the encoding of these parameters and warns that it may change. CMP vendors describe
G100as “everything denied” andG111as “everything granted”.
Compliant result: a default state of denied before any tag, an update sent on the page where the choice is made, and the state restored on the following pages. The full method is in check data collection (opens in a new tab).
How to implement
Before you start
Three decisions come before the code:
- The mode, basic or advanced, approved by your legal counsel or your data protection officer.
- The banner. A Google-certified CMP handles Consent Mode for you and keeps up with its changes. It is mandatory if you serve personalized ads with AdSense, Ad Manager or AdMob in the EEA, the United Kingdom or Switzerland; for GA4 and Google Ads alone, a custom-built banner is fine if it sends all four signals.
- The mapping between the banner's purposes and the signals. A common example, to be validated: “Analytics” drives
analytics_storage; “Advertising” drivesad_storage,ad_user_dataandad_personalization.
Google tag (gtag.js) installed by hand
Place the default state in the <head>, before the Google tag and before any config or event command:
<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>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
wait_for_update gives a banner loaded asynchronously 500 milliseconds to pass on a choice it has already stored. Then call the update in your banner's callback, on every choice and every change of mind:
function transmettreConsentement(choix) {
gtag('consent', 'update', {
'analytics_storage': choix.mesure ? 'granted' : 'denied',
'ad_storage': choix.publicite ? 'granted' : 'denied',
'ad_user_data': choix.publicite ? 'granted' : 'denied',
'ad_personalization': choix.publicite ? 'granted' : 'denied'
});
}
Store the choice (first-party cookie or localStorage) and send it again at the start of every page, otherwise the state goes back to “denied”.
Two options:
- By region: add
'region': ['FR', 'BE'](ISO 3166-2 codes) to a firstdefaultcall, then make a second call withoutregionfor the rest of the world. The most specific region wins. - Redaction:
gtag('set', 'ads_data_redaction', true)redacts ad click identifiers in requests whenad_storageis denied.
In basic mode, the first block is not enough: only insert the gtag/js tag after the visitor has chosen.
Google Tag Manager
Admin > Container Settings > Additional Settings: tick “Enable consent overview”.- Add your CMP's tag template from the Community Template Gallery. These templates use the
setDefaultConsentStateandupdateConsentStateAPIs, which Google recommends in a container overgtag('consent', …), sometimes processed too late. - Fire this tag on Consent Initialization - All Pages, which runs before every other trigger, including “Initialization”.
- Google tags (Google tag, Google Ads, Floodlight) have built-in consent checks: do not add anything to them. For the others, in
Advanced Settings > Consent Settings, require the relevant type (ad_storagefor an advertising pixel). - Preview all three journeys in Tag Assistant, then publish.
In basic mode, Google tags fire on the acceptance event pushed by the CMP, not on “All Pages”.
WordPress
Versions WordPress 6.4 and later; Site Kit by Google, WP Consent API, Complianz, CookieYes and Cookiebot in their November 2026 versions.
The path depends on what inserts the Google tag.
- Site Kit:
Site Kit > Settings > Admin Settings, turn on consent mode. Site Kit then sets the default state for visitors from the EEA, Switzerland and the United Kingdom, and waits for the choice passed on by the WP Consent API plugin. You therefore also need a compatible banner plugin: Site Kit's documentation mentions Complianz, CookieYes and Cookiebot. - Tag Manager: turn on Consent Mode in the banner plugin or use its GTM template, not both.
- Tag pasted into the theme: apply the gtag.js section, with the default state placed before the tag.
Shopify
Versions Shopify admin, all plans, November 2026; Customer Privacy API 1.0.
Shopify centralizes consent in Settings > Customer privacy and exposes it to scripts through the Customer Privacy API. Three cases:
- Native banner and the Google & YouTube channel: according to Shopify's help center, correctly configured privacy settings are enough for consent to reach Google.
- Third-party CMP: it must be connected to Shopify's privacy settings, that is, call
setTrackingConsentfrom the Customer Privacy API. Otherwise the pixels managed by Shopify ignore the choice. - Custom pixel (
Settings > Customer events): Shopify states that you have to insert the Consent Mode code into it yourself.
Example for a custom pixel, to be placed before the Google tag loads (the mapping of purposes is to be validated):
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function versGoogle(etat) {
return {
'analytics_storage': etat.analyticsProcessingAllowed ? 'granted' : 'denied',
'ad_storage': etat.marketingAllowed ? 'granted' : 'denied',
'ad_user_data': etat.marketingAllowed ? 'granted' : 'denied',
'ad_personalization': etat.marketingAllowed ? 'granted' : 'denied'
};
}
gtag('consent', 'default', versGoogle(init.customerPrivacy));
api.customerPrivacy.subscribe('visitorConsentCollected', (event) => {
gtag('consent', 'update', versGoogle(event.customerPrivacy));
});
Other platforms
On other CMSs and frameworks, the principle is that of the gtag.js section: default state first in the <head>, then the CMP, and the Google tag last. The loading order specific to each platform is described in handle applicable consent requirements (opens in a new tab).
Common mistakes
- Default state set after the tag: the first events are sent with no state, or with a granted state.
- Two signals instead of four: an integration that predates November 2023 only sends
ad_storageandanalytics_storage. - Update sent too late: it must be sent on the page where the choice is made, before any page change.
- Choice not restored on the following pages: every page starts again at “denied”.
- Assuming other tools are covered: Matomo, Plausible and the Meta pixel ignore Consent Mode.
Frequently asked questions
Is Consent Mode v2 mandatory?
Consent Mode v2 is not a legal obligation: it is a Google requirement. Google's consent policy covers visitors from the European Economic Area, the United Kingdom and Switzerland, and Google asks advertisers to pass this consent on to it in order to use ad measurement, ad personalization and remarketing. A site with no Google tag is not affected.
Is Consent Mode enough to be GDPR compliant?
No. Consent Mode passes on to Google tags a choice the visitor has already made; it does not collect that choice, keeps no proof of it and does not block any script from another vendor. Compliance depends on the banner, the information given, the ability to decline as easily as to accept, and trackers actually being blocked before consent.
Do I need to set up Consent Mode with Matomo?
No. Consent Mode only concerns Google tags: Google Analytics 4, Google Ads, Floodlight. Matomo, Plausible or any other tool without a Google tag does not read these signals and handles consent with its own methods. If the site combines Matomo and Google Ads, Consent Mode is still needed for Google.
Does Consent Mode v2 have any effect on SEO?
None. Consent Mode v2 governs what Google tags measure about visitors; crawlers do not read these signals, and they play no part in rankings or in the answers of generative engines. Its value lies in keeping usable data in GA4 despite visitors declining cookies.
Resources
- Google: Consent mode overview, basic and advanceddevelopers.google.com
- Google: Set up consent mode on websitesdevelopers.google.com
- Google: Troubleshoot consent mode with Tag Assistantdevelopers.google.com
- Google: Consent APIs for Tag Manager templatesdevelopers.google.com
- Tag Manager Help: Consent settingssupport.google.com
- Tag Manager Help: Updates to consent mode for traffic in the EEAsupport.google.com
- Google: EU user consent policygoogle.com
- Google Analytics Help: Behavioral modelingsupport.google.com
- Google Ads Help: Conversion modeling with consent modesupport.google.com
- AdSense Help: Certified CMP requirementsupport.google.com
- Site Kit: Consent modesitekit.withgoogle.com
- Shopify: Customer Privacy APIshopify.dev
- Shopify Help Center: Customer privacy settingshelp.shopify.com
Updated on
Topic checklist (PDF)