Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Consent Mode in essence is a mechanism that allows third party scripts to pass consent data to Google Tag Manager using the Global site tag (gtag) API.
This data can be used to conditionally load tags, or modify their behavior.

  • Consent Mode is not a Google service or product, it’s more like a consent API.

  • Consent Mode makes use of the dataLayer and only works with Google Tag Manager (or gtag).

  • Consent Mode is part of the larger Global site tag (gtag) API.

  • The Usercentrics CMP template tag registers default consent settings, so the consent mode script doesn’t need to be used. (No default consent on the page)

  • If you don’t implement Usercentrics CMP via the template tag in Google Tag Manager,  you’ll need to add a script to your page to enable it.

  • The Usercentrics script sends updated consent data when these are determined.

...

Code Block
<script type="text/javascript">
// create dataLayer
    window.dataLayer = window.dataLayer || [];
    
//Create the gtag API, so you don’t have to write dataLayer.push() and can use gtag() instead.   
    function gtag() {
        dataLayer.push(arguments); 
    }

//Use the gtag method to pass default consent settings to Google Tag Manager.
    gtag("consent", "default", {
        ad_user_data: "denied",
        ad_personalization: "denied",
        ad_storage: "denied",
        analytics_storage: "denied",
        wait_for_update: 2000 // milliseconds to wait for update
    });

// This allows the data that normally would be stored in a cookie to be appended to the URL instead.
    gtag("set", "ads_data_redaction", true);
</script>

//The last part is the Google Tag Manager script. If you want to use Consent Mode as alternative to prior blocking the type of the script tag is "text/javascript".
<script type="text/javascript">
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window, document, 'script', 'dataLayer', 'GTM-XXXXX'); //replace GTM-XXXXXX with Google Tag Manager ID
</script>

How Usercentrics and Consent Mode types works

Usercentrics CMP uses service level consent and that’s “hard” to link to the consent mode types as you may have ambiguous DPS consents.

That’s why Usercentrics currently support a strict way of, a storage type only gets granted if all of the services that are used (and linked to that type - currently a list of hardcoded predefined DPS) have consent.

In the Admin Interface, the services are included along with their corresponding consent types to ensure the consent mode type is  "granted" or "denied" based on the user choices

Based on our predefined Data Processing Services (DPS) we have a direct service-consent type correlation, you can find this in our docs:

e.g.

Code Block
Data Processing Service          |Temple ID    | CoMo type 
| Google Analytics 4             | 87JYasXPF   | analytics_storage 
| Google Ads Conversion Tracking | twMyStLkn   | ad_storage        
| Google Ads Remarketing         | B1Hk_zoTX   | ad_storage       
...

...

Default behavior:

...

Consent for Google Analytics 4 - 87JYasXPF activates analytics_storage

...

Default consent data in detail

Consent Type
Description
ad_storage
Enables storage (such as cookies) related to advertising.
ad_user_data
Sets consent for sending user data related to advertising to Google.
ad_personalization
Sets consent for personalized advertising.
analytics_storage
Enables storage (such as cookies) related to analytics e.g. visit duration.

In addition to the consent mode parameters, there are the following privacy parameters:

Storage Type
Description
functionality_storage
Enables storage that supports the functionality of the website or app e.g. language settings.
personalization_storage
Enables storage related to personalization e.g. video recommendations
security_storage
Enables storage related to security such as authentication functionality, fraud prevention, and other user protection.