Paul LovellBook a call
Back to Blog
5 min readPaul Lovell

Google Consent Mode v2 and Cookie-Domain Mapping Across Subdomains

Consent granted on the root domain needs to hold on every subdomain a user visits next — that only happens with correct cookie-domain configuration.

AnalyticsGA4Privacy

Consent Mode v2 is effectively mandatory for preserving measurement and ad personalisation signals under UK and EU privacy rules. When a user grants or denies consent, that signal — ad_storage, analytics_storage, ad_user_data, ad_personalization — has to propagate consistently across every subdomain they visit next, not just the page where they saw the banner.

Setting defaults before anything else loads

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
});

The part that actually breaks: cookie-domain scope

If a user accepts consent on example.com, that choice needs to apply on app.example.com or shop.example.com too — otherwise they see a duplicate consent banner and, worse, analytics silently fails between the disagreement. Set the consent management platform's cookie domain explicitly to the root host with a leading dot (.example.com), which propagates the consent cookie across every subdomain on that root rather than scoping it to a single host.

Paul Lovell

Written by

Paul Lovell

International SEO Consultant & Founder of Always Evolving SEO. 15+ years running technical audits, log-file analysis, and root-cause fixes for multimillion-dollar businesses — speaker at SMX London, Search & Content Summit, and SEMrush events.