Cookiebot Google Consent Mode V2

Cookiebot Google Consent Mode V2 integration 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 V2 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

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

For users who have already set consent mode. Google consent mode has added 2 new keys to its new version (V2). The new Google Consent Mode keys are ad_user_data and ad_personalization. The two new choices will be set based on the same trigger as ad_storage.

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_user_data: "denied",
        ad_personalization: "denied",
        ad_storage: "denied",
        analytics_storage: "denied",
        functionality_storage: "denied",
        personalization_storage: "denied",
        security_storage: "granted",
        wait_for_update: 500,
    });
    gtag("set", "ads_data_redaction", true);
    gtag("set", "url_passthrough", 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.

14 day free trial Cookiebot

Cookie scanner, cookie banner, cookie declaration and 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 1.4 million websites, manages 5.2 billion monthly User Consents and supports 47+ languages.