Cookiebot and Google Consent Mode (beta)

Cookiebot integration with Google Consent Mode (beta) makes it possible to respect the privacy choices of end users with minimal impact on your website’s ad-based revenue stream, analytics and more. If you’re already using Google gtag.js or Google Tag Manager (GTM) on your website, we recommend that you add Google Consent Mode (beta) integration to your website. This makes it possible to get the best results from your Google Services. The configuration described in this guide works with the following Google tags deployed via gtag.js and ‘Web’ containers in Google Tag Manager:

  • Google Ads (Google Ads Conversion Tracking and Re-marketing)
  • Floodlight
  • Google Analytics
Cookiebot and Google Consent Mode - gtag.js - CookieInfo
Cookiebot and Google Consent Mode

Benefits

Once you have implemented the integration on your website, Cookiebot will automatically signal the consent choices of your visitors to Google instead of blocking tags when not consented. The end user’s granular consent will be used by Google to adjust tag behaviour accordingly. This means for instance serving personalized ads to visitors that have opt’ed in to marketing cookies and tracking, or instead serving general interest ads relating to the content of your website when an “opt-out” is signaled. 

Without the integration, no ads will typically be served, as the scripts serving the ads will not be allowed to run without consent for marketing cookies. With the Google Consent Mode and the Cookiebot integration in place, Cookiebot will allow tags to run and Google will act to serve ads and log analytics data according to the signal sent by Cookiebot. 

Google describes the technical details of how supported tags changes behaviour based on the end user’s consent here: https://support.google.com/analytics/answer/9976101

Implementation

The Google Consent Mode is an API that Cookiebot integrates with. when you have installed the Cookiebot tag on your site (directly or via the GTM Template Gallery), you can enable the Google Consent API-integration by adding the following code snippet to your website template, above the gtag.js or GTM code itself: 

<script data-cookieconsent="ignore">
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }
    gtag("consent", "default", {
        ad_storage: "denied",
        analytics_storage: "denied",
        functionality_storage: "denied",
        personalization_storage: "denied",
        security_storage: "granted",
        wait_for_update: 2000,
    });
    gtag("set", "ads_data_redaction", true);
</script>

Make sure to add the above code before your gtag.js or GTM code snippet

Google’s API documentation suggests further steps to enable an integration, but as these are automatically handled by Cookiebot, nothing else is needed. You may change the values of ad_storage and analytics_storage to ‘granted’ and set ads_data_redaction to ‘false’ if you want to default to an opt-in before the end user has submitted consent, for example allowing for a default opt-in under CCPA.

If you are using Cookiebot with Google Tag Manager today, you must remove any applied cookie consent triggers from Google tags that support Consent Mode (as listed above) and add a different trigger like “All pages”.

To read more about Cookiebot, CookieInfo Custom Banners and Google Consent Mode and how this integration could help you get more our of your website, please see our blog post here

30 day free trial Cookiebot

Cookie scanner, cookie banner, cookie declaration en cookie consent in one solution.

  • Use cookies on your website compliant with GDPR, ePrivacy and cookie legislation
  • Cookie management completely automated
  • Cookie banner based on your corporate identity
  • Automatic composed cookie declaration, always up to date

The Cookiebot solution runs on 500,000+ websites, manages 13 billion User Consents and supports 40+ languages.