Google Consent Mode v2 Setup
Step-by-step instructions to synchronize ad_storage, analytics_storage, ad_user_data, and ad_personalization signals with Google tags.
Google Consent Mode v2 is mandatory for merchants running Google Ads, GA4, and remarketing in the European Economic Area (EEA) and the UK. WS Cookie Consent integrates directly with gtag.js and Google Tag Manager (GTM) with zero custom JavaScript required.
2024+ Compliance Requirement
Without Consent Mode v2 active, Google Ads conversion tracking and remarketing audiences for EEA/UK traffic are permanently degraded by Google.
Why Google Consent Mode v2 is Mandatory#
Consent Mode v2 introduces two new consent signals in addition to analytics and advertising storage: ad_user_data and ad_personalization. WS Cookie Consent automatically maps customer preferences to these signals.
Consent Signal Mapping#
| Google Signal | WS Cookie Category | Default (EEA) | Post-Consent |
|---|---|---|---|
analytics_storage | Analytics Cookies | denied | granted if opted in |
ad_storage | Marketing Cookies | denied | granted if opted in |
ad_user_data | Marketing Cookies | denied | granted if opted in |
ad_personalization | Marketing Cookies | denied | granted if opted in |
functionality_storage | Functional Cookies | granted | granted |
security_storage | Necessary Cookies | granted | granted |
Configuring with Google Tag Manager#
When Google Consent Mode v2 is enabled in WS Cookie Consent settings, default states are pushed to dataLayer before any tags execute:
// Initialized automatically at the top of <head>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'wait_for_update': 500
});Testing with Tag Assistant#
Open tagassistant.google.com, connect your store URL, and click Accept All on your banner. In Tag Assistant's Consent tab, you will observe the state transitions from denied to granted.
Have feedback or question about this guide?
Our commerce engineering studio provides direct developer assistance.