ConsentCheck

Consent Mode v2 Snippet (Default Denied) – Generate & Test Your Setup

Incorrect Consent Mode v2 setups can silently break Google Ads attribution. Campaigns keep spending, but conversions are lost or misattributed.

If your Consent Mode v2 setup is wrong, Google Ads can lose conversions or break attribution.

This snippet sets default denied correctly, but implementation mistakes (timing, updates, tags) can still break tracking.

Generate your snippet below, then test if it actually works on your site.

After adding this snippet: prove it in real behavior

Most Consent Mode v2 setups look correct but fail in real behavior.

Common issues:

  • Consent update never fires
  • Tags bypass consent
  • Timing is wrong → conversions lost

Before trusting your setup:

🔍 Run Full Consent Mode Check →

Quick pass: Lite checker →

Why this matters

This snippet helps Google receive Consent Mode v2 signals, but only if updates and tag timing match. Otherwise Ads may suppress attribution while spend continues.

Common mistakes

Decode consent signals: GCS decoder · Check attribution signal propagation: GCLID checker.

One of these issues is likely affecting your setup.

Check your site to see exactly what's broken:

Diagnose My Consent Setup →

We'll add the G- prefix if missing.

We'll add the AW- prefix if missing.

Want a CMP example for Didomi? Didomi + Consent Mode v2 wiring →

Pre-fills the scanner so you can test this code on your live site.

Test this exact code on my live site

After you add the snippet, run a free scan to confirm Consent Mode v2 and tracking behave correctly.

Test my site now →

Live preview

<!-- Consent Mode v2 – Paste BEFORE any Google tags (gtag, GTM, GA4) -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}

  // Default: deny all until user consents (GDPR/CCPA compliant)
  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>

Enter your GA4 ID above to replace the placeholder in the snippet.

Consent Mode v2 snippet example (default denied)

Here's what a correct Consent Mode v2 setup should include:

  • Default denied for all relevant signals (ad_storage, analytics_storage, plus ad_user_data / ad_personalization for v2)
  • Proper wait_for_update handling so the CMP can update before tags treat consent as final
  • Consent update on user action, gtag('consent', 'update', …) when accept/reject fires

Common mistake: implementing the default-denied snippet correctly but never firing a consent update, tracking breaks silently while the page “looks” compliant.

After implementing Consent Mode, test if conversions are actually firing:

Test Google Ads conversion tracking →

Why your Consent Mode v2 setup might still be broken

Even with the correct snippet:

  • Tags can fire before consent
  • CMP integration may fail (callback never calls update)
  • Consent signals may not reach Google Ads (payload / timing / linker)

Result: missing conversions and poor campaign optimization.

Run a full scan to verify your implementation end-to-end on a real URL.

🔍 Run free tracking scan →

Official Google Consent Mode documentation →

Related guides:

Advanced setup: Server-side GTM + Consent Mode v2