How to activate/enable the Google Consent Mode?

To activate Google Consent Mode in Seers Consent Management Platform (CMP)

How to install Google Consent Mode?

You need a Google Analytics code to activate Google Consent Mode on your website. To enable this feature, simply follow these steps; 

Step 1:

Find the Google Analytics code in the header on the website or get it from your Google Analytics account.

The Google Analytics code looks like this:

<!-- Global site tag (gtag.js) - Google Analytics -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxx-x></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxxx-x');

</script>

Step 2:

Insert Google Consent Mode code (below in bold) before your Google Analytics Code or 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, 11});
gtag('set', 'ads_data_redaction', true);
</script>

<!-- Global site tag (gtag.js) - Google Analytics -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxx-x></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxxx-x');

</script> 

Step 3: 

Now, insert the Seers' CMP code after the Google Consent Code and before the Google Analytics code. 

Note: To activate Google Consent Mode, you must have Seers’ CMP code installed on your website. Which will look like the code below: 

<script data-key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" data-name="CookieXray" src="https://seersco.com/script/cb.js" type="text/javascript"></script>

Step 4: 

After adding Seers' CMP code, your actual code should look like this. 

<!-- 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, 11});
gtag('set', 'ads_data_redaction', true);
</script> 

<script data-key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" data-name="CookieXray" src="https://seersco.com/script/cb.js" type="text/javascript"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxx-x></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'UA-xxxxxxxxx-x');

</script> 

  1. Google Consent Mode is an optional feature and should be enabled in settings too. Go to your Dashboard > Preferences tab Enable Google Consent Mode
  2. Remember to enable the toggle button to “OK” to activate Google Consent Mode in the “settings” panel of the Seers CMP.
  3. Also, you must update the Google Analytics code, as described in Step 2. 

To read more about Google consent mode click here.