What do I need to do to prepare for Google Consent Mode?

What if I don't want to enable Google Consent Mode?

If you became a customer of Cookie Information after the 24th of February, or you are an existing customer who did not implement Google Consent Mode before that date, then there are a few steps you will need to do in order to ensure that Google Consent Mode is correctly set up.

What do I need to do to prepare for Google Consent Mode?

  • If you have already implemented the Cookie Control SDK, you will need to remove references to cookie_cat_xxx (normally satistic or marketing) on Google Analytics and Ads tags
  • The snippet for the initial config of Google Consent Mode is placed in the <head> above the uc.js script and gtag or Google Tag Manager script:
<!-- 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>

In order to make sure that tracking occurs on all pages where Consent Mode is implemented (so that you get the most aggregated data), you will also need to add one more attribute just above the closing </script> tag:

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

This means that the complete setup of Google Consent Mode should look similar to the below (with all scripts in the correct order):

<!-- 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>
<body>

What if I don't want to enable Google Consent Mode?

If you'd like to disable Google consent Mode, please add the following attribute to the uc.js script:

data-gcm-enabled="false"


Did this answer your question?