If you'd rather read less about the ins and outs of Consent Mode and instead just want to learn how to get it set up and working, please refer to the following articles:

Updating your Google Consent Mode Implementation if you implemented it before it became the default (prior to the 24th of February 2021)

Implementing Google Consent Mode now that it is the default

Cookie Information and Google - easier integration

Cookie Information has entered into a partnership with Google, which means that your integrations between Google products and Cookie Information will become more straight forward.

Google Consent Mode will work without any additional configuration of settings within your Cookie Information account on our platform.

However, just like you have to place the consent pop-up script on your site, you will also need to add a script for Google Consent Mode to be recognised.

Please see the code snippet under the heading How to implement Google Consent Mode, as this is what you will need to place in the <head> section of the source code on your site.

If you have implemented the consent pop-up using our WordPress plugin, Google Consent Mode will be enabled by default as well.

By enabling Google Consent Mode, you are letting Google know that it's possible to use it. The vendor ID is also passed on to Google (so that they are aware that we are your CMP).

What is Google Consent Mode

Google Consent Mode is a new API from Google which makes it easy for websites to measure conversions and traffic in Google Ads and Google Analytics.

With Google Consent Mode your website can get data from Ads campaigns, attribute conversions, and measure website traffic on an aggregated level even though users decline the use of cookies.

This is still in BETA at Google.

Read about GCM API at Google Developers.

How does this aggregate level of data work?

Once implemented, Consent mode uses pings instead of cookies to communicate that events have happened.

Events that pings are used for are:

  • Consent status: Pings are sent from each page a user visits (this also includes whether consent given by the user has been changed) for each cookie category.

  • Conversions: If a conversion happens, pings are sent to say that this has taken place.

  • Google Analytics: Pings are sent on the pages where Google Analytics has been implemented - any visits and events get logged.

When consent is given, any associated tags function as usual and Google Ads and Analytics can be used for measurement and retargeting as they were before.

In the case of using Consent mode with Google Ads, you won't get personal data about your visitors - but you'll still be able to track conversions from Ads campaigns overall.

To read more about Google Consent Mode’s behaviour, please refer to Google's own documentation (the section named "Consent mode behavior").

Which Google products does Google Consent Mode support?

The following Google products are supported:

  • Google Ads

  • Google Analytics

  • Floodlight

This means that Google Consent Mode will only have control over the three mentioned above when they are tags in Google Tag Manager.

When can you use Google Consent Mode?

If you are using Google's new gtag script, Google Analytics, or Tag Manager, then you can use the new Consent Mode API.

The Global site tag script looks as shown below:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKING-ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'TRACKING-ID');
</script>

How to implement Google Consent Mode

To enable and set the initial configuration of the Consent Mode, you will need the code snippet below.

The script must be placed above the gtag or GTM script that you already have on your website.

Our uc.js pop-up script must still be in the <head> of your site - if it is added via Google Tag Manager it will not work.

The two parameters are used to indicate whether Google Analytics or Google Ads should be enabled on the website. By default the parameters should be set to “denied”:

  • ad_storage

  • analytics_storage

Both parameters are set to deny, so the analytics platform and the ads platform will not set any cookies on the initial load but will be executed when consent is given.

It's also worth noting that the attribute ads_data_redaction is optional, though we've included it in our example.

<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
});
gtag('set', 'ads_data_redaction', true);
</script>

Updating implementation for Google Adwords and Analytics

Of course, you still want to be able to properly track coversions as your visitors move through the site. In order to do this when using the gtag script, you'll need to add one more property to the Google Consent Mode script:

gtag('set', 'url_passthrough', true);

When using Tag Manager, you'll need to enable it via your Conversion Linker tag. Under the Linker Options, select the option to enable linking on all page URLs.

Example of a complete setup

<head>
<!-- The initial config of Consent Mode -->
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
wait_for_update: 500,
});
gtag('set', 'ads_data_redaction', true);
</script>

<!-- Cookie Information Pop-up Script is required for the SDK -->
<script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="EN" type="text/javascript"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKING-ID"></script>
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'TRACKING-ID');
</script>

</head>

Please be aware that if you have copied the example of the complete setup, you will need to remove the last block of code starting with the line <!-- SDK for inline script that triggers Consent Mode on user consent --> on the 24th of February.

What if I don't want to enable Google Consent Mode when it is turned on by default by Cookie Information?

In order to ensure to revert and see that Google Consent Mode is turned off, you can do so manually by adding a custom data attribute to the uc.js file:

data-gcm-enabled="false"

If you are using the WordPress plugin, then you can disable Google Consent Mode by going into the Cookie Information plugin settings and turning the Consent Mode toggle off.

If you are not using Google Analytics, Google Ads, or other Google Products that are compatible, then Google Consent Mode will not take effect.

What does this mean for me? How do I know what to keep and what to change?

The following covers the most common scenarios based on whether you have (or haven't) already completed the preliminary implementation (prior to the 24th of February 2021).

You have already completed the implementation of Google Consent Mode

If you have enabled Google Consent Mode via the Cookie Control SDK or outside of your Cookie Information configuration you will need to make sure this is adjusted accordingly.

If Google Analytics and Ads are managed via Google Tag Manager, you will need to go into your Google Tag Manager container and remove any Cookie Information triggers that are set on Google Analytics or Ads.

If Google Analytics and Ads are managed using a script placed on your website such as analytics.js, you will need to update your SDK implementation to reflect this by removing the code snippet contained in the section How to use the Cookie Control SDK to trigger the Consent Mode on consent, as this will now be taken care of by Consent Mode.

You will also need to remove the code snippet starting with <!-- SDK for inline script that triggers Consent Mode on user consent -->

You still need to keep the initial config of Google Consent Mode script in the <head> tag of your site placed above the uc.js (pop-up) script, and Google Tag Manager script, or gtag.js script.

You have not done any implementation of Google Consent Mode, but would like to use it

If you have not done any preliminary implementation of Google Consent Mode, then you will need to make sure that you are using the latest version of Google’s gtag, Google Analytics, or Google Tag Manager.

If Google Analytics and Ads are managed via Google Tag Manager and are being controlled by our SDK, you will need to go into your Google Tag Manager container and remove any Cookie Information triggers that are set on Google Analytics or Ads.

If Google Analytics and Ads are managed using a script placed on your website such as analytics.js, you will need to update your SDK implementation to reflect this by removing the code snippet contained in the section How to use the Cookie Control SDK to trigger the Consent Mode on consent on the 24th of February, as this will now be taken care of by Consent Mode.

You will also need to place the initial config for Consent Mode code snippet in the <head> of your site above the uc.js (pop-up) script, and Google Tag Manager script.

You do not want to enable Google Consent Mode

If you are using the latest version of Gtag, but do not want to enable Google Consent Mode, then you will need to add one attribute to the uc.js (pop-up) script that goes in the <head> of your site:

data-gcm-enabled="false"

You are using the WordPress plugin but do not want to enable Google Consent Mode

You can disable Google Consent Mode by going into the Cookie Information plugin settings and turning the Consent Mode toggle off. This will add the attribute above to the uc.js script.

Did this answer your question?