Google Consent Mode
Google allows using its own consent mode in order to comply with the privacy regulations without disabling services provided by Google, such as Google Analytics or Google Ads. More information about Google Consent Mode is available in the official Google Consent mode documentation
Google’s Consent Mode applies to the following products deployed using either the global site tag (gtag.js) or Google Tag Manager (GTM):
- Google Ads
- Floodlight
- Google Analytics
- Conversion Linker
CookieScript has full integration with Google Consent Mode:
- Tag Manager Community Template available
- Integrated with consent update calls
- Integrated with consent default calls
- Supported consent types:
- ad_storage
- analytics_storage
- functionality_storage
- personalization_storage
- security_storage
How to implement Google Consent Mode with CookieScript GTM Tag template
This is the easiest implementation since it requires no coding whatsoever. However, it only applies to users who are using Google Tag Manager (GTM). If you are not using Google Tag Manager, skip to the next section with manual Consent mode implementation.
We have created a GTM Tag template that does all the necessary coding for you. Just follow the steps to deploy CookieScript using a community Tag Template and the Tag will do all the magic.
Google Consent Mode is an optional feature and should be enabled in settings too. Go to your banner settings > Behaviour tab > Enable Google Consent Mode. You can optionally change a category that allows Ads Storage, Analytics Storage, Functionality Storage, Personalization Storage, and Security Storage in Google Consent mode.
How to implement Google Consent Mode manually
In order to enable Google Consent Mode, include this code snippet just before including gtag.js or GTM snippet:
<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>
It is important to include this code before your gtag.js or GTM code snippet. In case your dataLayer was renamed, you should also rename it in the code above.
Google Consent Mode is an optional feature and should be enabled in settings too. Go to your banner settings > Behaviour tab > Enable Google Consent Mode. You can optionally change a category that allows Ads Storage, Analytics Storage, Functionality Storage, Personalization Storage, and Security Storage in Google Consent mode.
How CookieScript categories map to Google Consent types
Unlike other Consent Management Platforms, CookieScript allows you to map Google Consent types with categories used in your banner. This can be done in your banner settings > Behavior tab > Google Consent mode section.
Google consent type | CookieScript mapped category (can be adjusted in banner settings) |
ad_storage (required) | Targeting |
analytics_storage (required) | Performance |
functionality_storage (optional) | Functionality |
personalization_storage (optional) | Functionality |
security_storage (optional) | Functionality |