Skip to content

Documentation

Auto-Block Scripts with Google Consent Mode v2

Auto-Block Scripts with Google Consent Mode v2

Last updated Mar 31, 2026

Kukie's auto-blocker and Google Consent Mode v2 (GCM) work together to balance privacy compliance with data quality. When both are enabled, Kukie automatically allows Google scripts to load while Consent Mode controls what data is collected - and non-Google scripts remain blocked until consent is given.

How it works

The auto-blocker and GCM interact differently depending on whether Consent Mode is enabled.

Without Google Consent Mode v2

When GCM is disabled, the auto-blocker treats Google scripts the same as any other third-party tracker:

  • Google Analytics, GTM, and gtag.js are blocked until the visitor consents
  • Visitors who reject or ignore the banner generate zero data in Google Analytics
  • This is the strictest, most privacy-preserving approach
  • No cookieless pings, no conversion modelling - Google receives nothing until explicit consent

With Google Consent Mode v2 enabled

When GCM is enabled, Kukie automatically exempts Google scripts from the auto-blocker. Here is what happens on every page visit:

  1. Kukie sets all consent parameters to denied by default
  2. Google scripts (GTM, GA4, gtag.js) load immediately - they are not blocked
  3. Google sends cookieless pings - no cookies are set, no personal data is collected
  4. When the visitor accepts, Kukie updates consent parameters to granted and full tracking begins
  5. Google uses the denied-state pings for conversion modelling, filling measurement gaps

Non-Google scripts (Facebook Pixel, TikTok Pixel, LinkedIn Insight Tag, Hotjar, and others) are still auto-blocked until the visitor consents to the relevant cookie category.

Tip: This exemption is automatic. When you enable GCM v2 in the Integrations tab, Kukie recognises Google script domains and allows them through the auto-blocker. No manual configuration is needed.

Choose the setup that matches your compliance and data requirements:

Setup Auto-Block GCM v2 Result
Maximum privacy On Off All non-essential scripts blocked until consent. No data for non-consenting visitors.
Balanced (recommended) On On Google scripts load with Consent Mode restrictions. Non-Google scripts blocked. Cookieless pings preserve modelled data.
Manual control Off On All scripts load freely. Consent Mode controls Google tags only. Other scripts need manual blocking via tag manager.

Recommended: For most sites, the Balanced configuration gives the best results - you stay compliant, non-Google trackers are blocked, and Google's conversion modelling fills the gaps from non-consenting visitors.

Server-side Google Tag Manager

If you use a server-side GTM container (hosted on Cloud Run, Cloud Functions, or a custom server), the interaction between auto-blocking and Consent Mode is especially important.

The problem without GCM v2

Server-side GTM depends on the client-side GTM container loading first. The client-side container sends data to your server-side endpoint, which then forwards it to Google Analytics, Google Ads, and other destinations.

If the auto-blocker prevents the client-side GTM container from loading, no data reaches the server container at all - not even anonymised pings. Your server-side setup effectively goes dark for non-consenting visitors.

The solution with GCM v2

With GCM v2 enabled:

  1. The client-side GTM container loads on every page visit (exempted from auto-blocking)
  2. It sends cookieless pings to your server-side container in the denied consent state
  3. Your server container receives data for all visitors - denied pings for non-consenting, full data for consenting
  4. Server-side tags respect the consent state passed from the client container
  5. Google uses these pings for conversion modelling and basic traffic measurement in GA4

Important: If you use server-side GTM, enabling GCM v2 is strongly recommended. Without it, your server container receives no data from visitors who have not consented, which can represent 30-70% of your EU/EEA traffic.

Verifying your setup

Follow these steps to confirm that auto-blocking and Consent Mode are working correctly together:

  1. Open your site in an incognito/private browser window
  2. Open DevTools (F12) and go to the Network tab
  3. Filter requests by google or gtm
  4. Before interacting with the banner, you should see requests to googletagmanager.com - this confirms Google scripts are loading before consent
  5. Check the request parameters - look for gcs=G100 or similar, which indicates the denied consent state
  6. Click Accept All on the banner
  7. New requests should appear with gcs=G111, indicating the granted consent state

If you do not see Google requests before interacting with the banner:

  • Check that Google Consent Mode v2 is enabled in your site's Integrations settings
  • Clear your browser cache and cookies, then reload the page
  • If you use CDN bundles, regenerate them after changing integration settings
  • Add ?kukie_debug=1 to your URL and check the browser console for detailed Kukie logs

Expected impact on analytics

With the Balanced configuration (auto-block on, GCM v2 on), here is what to expect in your analytics:

  • GA4 uses conversion modelling to estimate data from non-consenting visitors based on cookieless pings
  • Expect to see 10-30% lower raw traffic numbers compared to pre-banner, but modelled conversions should be close to actual numbers
  • Google Ads and GA4 reports show a "modelled" indicator when conversion modelling is applied
  • It takes 7-14 days for Google's modelling to calibrate after you first enable Consent Mode
  • Conversion modelling requires a minimum traffic threshold - approximately 700 ad clicks over 7 days for a given domain and country combination

Tip: Do not compare raw numbers between pre-banner and post-banner periods. Instead, compare modelled conversions and overall trends. Google's conversion modelling is designed to fill the measurement gap caused by consent requirements.

Troubleshooting

Symptom Likely cause Fix
GA traffic dropped drastically after adding the banner GCM v2 not enabled - auto-blocker is blocking Google scripts Enable Google Consent Mode v2 in Banner Editor > Integrations
Server-side GTM container shows zero requests Client-side GTM not loading because it is auto-blocked Verify GCM v2 is enabled - this allows the client-side GTM container to load before consent
GA shows traffic but no conversions Consent update not firing on accept Contact support - this may indicate a banner configuration issue
Google Tag Assistant shows "No consent detected" Kukie script loading after GTM Ensure the Kukie script is the first script in your page's <head> tag, or use Kukie's built-in GTM injection
Non-Google scripts still loading before consent Auto-block may be disabled Enable Auto-block scripts in Banner Editor > Settings

Non-Google scripts

The Google script exemption applies only to Google domains. All other third-party scripts remain subject to auto-blocking:

  • Facebook Pixel - blocked until the visitor consents to the Marketing category
  • TikTok Pixel - blocked until consent
  • LinkedIn Insight Tag - blocked until consent
  • Hotjar / Microsoft Clarity - blocked until the visitor consents to the Analytics category
  • HubSpot tracking - blocked until consent
  • All other recognised tracker patterns (30+ built-in) - blocked until the relevant category is consented to

To use Microsoft Clarity's consent mode (similar to Google's), enable it separately in the Integrations tab. See Microsoft Clarity Consent Mode for details.

Was this helpful?

Listed On