Connect the cookie banner to Google Consent Mode v2 (Google Ads and Meta conversion tracking)

Connect the CrocoClick cookie banner to Google Consent Mode v2 to enable Google Ads and Meta conversion tracking upon consent.

Written By Baptiste Lorreyte

Last updated About 2 months ago

The CrocoClick cookie consent banner does indeed record your visitors' choice (the cookie-config cookie is set), but by default it does not transmit this choice to Google. As a result, even after clicking “Accept All,” Google remains in “denied,” your requests are sent with “gcs=G100,” and no Google Ads conversions are tracked.

This guide explains how to create the “bridge” between the native banner (Set up the cookie consent banner on your CrocoClick sites and funnels) and Google Consent Mode v2, so that accepting cookies actually activates your tracking. The same principle applies to the Meta Pixel.

The “why”: what’s actually happening

The native banner handles two distinct tasks:

  1. It displays the banner and stores the visitor’s choice in a cookie.

  2. It triggers an event when a choice is made (for example, `LCCookieConsentDoneGTM`).

However, if you simply paste the standard GTM or Google Analytics code, no one is listening for this event. The choice is therefore stored but never transmitted to Google.

This is the exact cause of the blockage with Consent Mode v2: the internal status remains “default: denied” for all four categories, and no “consent update” is sent.

🟢 Important: The native banner is fully compatible with Google Consent Mode v2. The only thing missing is the code that listens for its event and triggers the `xml-ph-0001@deepl.internal`.

The solution: Replace your tracking code with the consent-compatible version

The code below replaces your existing GTM, Google Analytics, or Meta Pixel code. Place it in the header tracking code (Site or Funnel Settings, or Page Header Settings).

⚠️ Note: Do not paste this code IN ADDITION to your old tracking code. Remove the old code first; otherwise, the tags will load twice and consent will not be honored.

Option A: You use Google Tag Manager (GTM)

<!-- Consentement par défaut : tout refusé au chargement --><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",  });  window.addEventListener(    "LCCookieConsentDoneGTM",    function (cookieConsent) {      if (cookieConsent.detail.gtm === 'grant'){        gtag("consent", "update", {          ad_storage: "granted",          ad_user_data: "granted",          ad_personalization: "granted",          analytics_storage: "granted",        });      }    },    !1  );</script><!-- Google Tag Manager : remplacez GTM-XXXXXX par votre ID --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXXXX');</script>

Option B: You’re using Google Tag / Google Analytics (gtag.js) directly

<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",  });  window.addEventListener(    "LCCookieConsentDoneGTag",    function (cookieConsent) {      if (cookieConsent.detail.gtag === 'grant'){        gtag("consent", "update", {          ad_storage: "granted",          ad_user_data: "granted",          ad_personalization: "granted",          analytics_storage: "granted",        });      }    },    !1  );</script><!-- Google tag (gtag.js) : remplacez TAG_ID par votre ID --><script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script><script>  gtag("js", new Date());  gtag("config", "TAG_ID");</script>

Option C: You’re using the Meta Pixel (Facebook)

<script>    !function(f,b,e,v,n,t,s)    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?    n.callMethod.apply(n,arguments):n.queue.push(arguments)};    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';    n.queue=[];t=b.createElement(e);t.async=!0;    t.src=v;s=b.getElementsByTagName(e)[0];    s.parentNode.insertBefore(t,s)}(window, document,'script',    'https://connect.facebook.net/en_US/fbevents.js');    fbq('consent', 'revoke');    fbq('init', '{votre-pixel-id}');    fbq('track', 'PageView');    window.addEventListener('LCCookieConsentDoneFB',function(cookieConsent){    fbq('consent', cookieConsent.detail.fb)},!1)</script>

💡 TIP: This code does three things: Upon page load, Google remains in “denied” status (normal and compliant). When “Accept All” is clicked, it listens for the banner event and sends a consent update set to “granted.” Upon reload, the banner re-triggers the event if the choice has already been made.

The noscript trap

⚠️ Note: If your original GTM code contained a `<noscript>` tag (the one intended for `<body>`), remove it. The banner is a JavaScript solution; `<noscript>` can set cookies without requiring consent, which violates compliance.

Verify that it works

Use the Google Tag Assistant extension or your browser’s Network tab, in incognito mode after deleting cookies from the domain:

Time

Expected result

Before consent

The 4 signals (ad_storage, ad_user_data, ad_personalization, analytics_storage) are set to "denied"

After "Accept All"

All 4 signals change to "granted"

Google request after acceptance

The gcs parameter changes from G100 to G111

🟢 Important: gcs=G111 confirms ad_storage and analytics_storage. Since Consent Mode v2 adds ad_user_data and ad_personalization, also check the full status in Tag Assistant (gcd parameter) to validate all 4 signals.

Alternative: Use a third-party CMP (Axeptio, Cookiebot, etc.)

If you prefer advanced management (consent history, reopening the preferences panel, official GTM templates), you can disable the native banner and install a third-party CMP compatible with Consent Mode v2 via the funnel header tracking code. This is possible without any conflicts, provided you follow these rules:

  • Keep only one consent manager active.

  • Disable the native CrocoClick banner (see below).

  • Remove any old Consent Mode scripts that might cause conflicts.

  • Follow the documentation for your chosen CMP for GTM, Google Ads, and GA4.

  • Check in Tag Assistant to ensure that all 4 signals are up to date.

Properly disable the native banner (to avoid two banners)

  1. Open the relevant site or funnel in the Builder.

  2. Go to the relevant page.

  3. Click the Cookie Consent Banner icon (cookie icon).

  4. Disable the banner button.

  5. Save and republish.

  6. Test in incognito mode after clearing the domain’s cookies.

🟢 Important: Consent applies at the domain level. By disabling the banner, you remove it from all pages on the relevant site or funnel.

Frequently Asked Questions

To configure the banner itself, see: Configure the cookie consent banner on your CrocoClick sites and funnels.

To set up your GTM or GA codes, see: How to add Google Tag Manager or Google Analytics to track a funnel or website on CrocoClick