Cluster 15 · Google Consent Mode v2 · ad_user_data + ad_personalization

Google Consent Mode v2 Default-Denied Generator (EEA/UK/CH + Wait for Update)

Generate a strictly ordered Google Consent Mode v2 default-denied block covering ad_storage, analytics_storage, ad_user_data, and ad_personalization with ads_data_redaction and 500ms wait_for_update.

100% Browser-Side · Zero User-Data Upload · Strict CSP

Compliance & Pre-Consent Control Specification

Control / Signal Compliant Baseline Engineering & Privacy Rationale
ad_storage 'denied' (default) Blocks Google Ads conversion & remarketing cookies until affirmative marketing opt-in
analytics_storage 'denied' (default) Prevents setting _ga / _gid identifiers pre-consent under GDPR & ePrivacy Art. 5(3)
ad_user_data 'denied' (default) Consent Mode v2 signal governing sending consented user data to Google advertising endpoints
ad_personalization 'denied' (default) Consent Mode v2 signal controlling personalized remarketing audience eligibility

Google Consent Mode v2 Pre-GTM Default-Denied Script

consent-mode-v2-default.html
<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',
    'functionality_storage': 'denied',
    'personalization_storage': 'denied',
    'security_storage': 'granted',
    'wait_for_update': 500,
    'region': ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IS','IE','IT','LV','LI','LT','LU','MT','NL','NO','PL','PT','RO','SK','SI','ES','SE','GB','CH']
  });
  gtag('set', 'ads_data_redaction', true);
</script>

Consent Update Call On User Acceptance

consent-mode-v2-update.js
export function applyCmpConsentChoice({ analytics, marketing }) {
  window.gtag?.("consent", "update", {
    analytics_storage: analytics ? "granted" : "denied",
    ad_storage: marketing ? "granted" : "denied",
    ad_user_data: marketing ? "granted" : "denied",
    ad_personalization: marketing ? "granted" : "denied"
  });
}

Implementation Steps & Key Insights

  1. Place the `gtag('consent', 'default', ...)` snippet in `<head>` strictly BEFORE loading `gtm.js` or `gtag/js`.
  2. Set all 4 Consent Mode v2 parameters (`ad_storage`, `analytics_storage`, `ad_user_data`, `ad_personalization`) to `'denied'` for EEA/UK/CH or globally.
  3. Enable `ads_data_redaction: true` so click IDs (`gclid`, `dclid`) are stripped while `ad_storage` remains denied.
  4. Trigger `gtag('consent', 'update', ...)` only after your CMP banner receives an explicit affirmative interaction.
  • Since March 2024, Google Ads EEA/UK remarketing and Customer Match require both `ad_user_data` and `ad_personalization` in addition to v1 signals.
  • Loading `gtm.js` before `gtag('consent', 'default')` causes a race condition where initial pageview hits fire with granted or missing `gcs`/`gcd` flags.
  • Pair Consent Mode v2 markup with live pre-consent network & cookie verification on `consent.runglab.dev`.

Common Pre-Consent Pitfalls

  • Only denying `ad_storage` and `analytics_storage` while omitting `ad_user_data` and `ad_personalization`.
  • Placing `gtag('consent', 'default')` in a deferred bundle or GTM Custom HTML tag that executes after GTM initialization.
  • Forgetting to restore saved CMP preferences synchronously before the 500ms `wait_for_update` window expires.
Verify Live: Audit your production site on consent.runglab.dev or grab the $39 ConsentCheck Compliance Pack. Not legal advice.

More GDPR, Consent Mode v2 & GPC Implementation Guides

← Back to GDPR & Consent Mode v2 Hub · ConsentCheck Live Audit → · $39 Compliance Pack → · Cluster 4: Security Headers → · Cluster 11: PCI & SRI →

Frequently Asked Questions

Where must `gtag('consent', 'default', ...)` be placed relative to GTM?

It must run immediately in `<head>` BEFORE the GTM `<script>` snippet so GTM reads the denied defaults before evaluating its All Pages triggers.

What does `wait_for_update: 500` do?

It instructs Google tags to pause up to 500 milliseconds on page load while an asynchronous CMP loads a returning visitor's previously saved consent choice.

How do I verify my site isn't setting cookies before consent?

Run a live headless browser + cookie audit on https://consent.runglab.dev/?ref=tool-consent-cluster to verify pre-consent cookies and Consent Mode signals.