Google Consent Mode 2.0 (GDPR TCF - web)

   Permission: Vendor list - GDPR

Google Consent Mode 2.0 ensures that Google vendors on your property comply with an end-user's consent choices for purposes (called consent checks) defined by Google. When a website visitor  indicates their consent choices, tags with consent checks adjust their behavior, and user consent choices are preserved across their interaction with the website.

In this article, we will cover how to configure the integration between Sourcepoint and Google Consent Mode 2.0 for a web property that is running a GDPR TCF campaign.  

  Note: Be advised that Google Consent Mode 2.0 only impacts your organizations if you use one or more of the following Google products:

  • Google Ads
  • Google Analytics
  • Search Ads 360
  • Campaign Manager 360
  • Display & Video 360

Consent check overview

Consent check(s) indicates the kind of storage a Google vendor uses.  An end-user can deny or grant the collection of this data. The consent check varies across each Google vendor and can be viewed by selecting a vendor from the GTM platform and expanding the Advanced Settings > Consent Settings tab.

Screen Shot 2022-06-29 at 9.09.12 AM.png

Please refer to the table below for the different consent checks available in Google Consent Mode 2.0:

Consent check Values Description
ad_storage granted | denied Enables storage (such as cookies) related to advertising.
analytics_storage granted | denied Enables storage (such as cookies) related to analytics (e.g. visit duration).
ad_user_data granted | denied Set to granted when end-user has consented to have their data shared with Google. 
ad_personalization granted | denied Set to granted when the user has consented to have their data shared with Google for the purposes of ad personalization.

Google Tag Manager vs gtag.js

Before configuring the implementation, your organization will need to decide whether to implement using Google Tag Manager or gtag.js.

Google Tag Manager gtag.js

Follow the directions in your Google Tag Manager account to install Google Tag Manager on your property. Installing GTM on your property requires adding a code snippet to your <head> tag and a code snippet to your <body> tag. 

Ensure that you define the data layer before Sourcepoint's tags (i.e. add the GTM code snippet before Sourcepoint's tags within the <head> tag)

Screen_Shot_2022-06-23_at_11_36_46_AM.jpeg

  Note: Be aware that if implementing Basic consent mode, in addition to defining the dataLayer you will need to also define a function that controls the firing of Google tags based on the end-user's consent. Leverage the grants object in the getCustomVendorConsents API to implement this function that suits your organization's needs. If implementing Advanced consent mode, you will only need to define the dataLayer as described above.


Implement Google Consent Mode 2.0 on web

Sourcepoint supports four different ways to implement Google Consent Mode 2.0 on your property running a GDPR TCF campaign. Click the tabs below to review which implementation method is suitable for your organization:

Google Tag Manager (Preferred) Google Tag Manager (no flag) gtag.js (Preferred) gtag.js (no flag)

The preferred method of implementing Google Consent Mode 2.0 on your web property using Google Tag Manager requires enabling an Advanced Setting flag in your GDPR TCF vendor list associated with your property. 

From the GDPR TCF vendor list associated with your property, add the "Google Advertising Products" vendor (GV: ID 755), which is required for this implementation method.

  Note: If you leverage any Google Products that require analytics_storage you may add additional custom vendors to your vendor list that best represent your Google product usage (e.g. Google Analytics). In addition to adding these custom vendors you will need to configure GTM containers, a new custom purpose, etc... see below for more information

Screenshot 2024-02-05 at 12.53.38 PM.png

Once the Google vendors are added to the vendor list, click Advanced Settings.

Screenshot 2024-02-05 at 12.59.12 PM.png

Enable the checkbox for Use TCF to Enable Google Consent Mode 2.0.

Click Apply Changes when finished. 

Screenshot 2024-02-08 at 10.48.24 AM.png

Save your vendor list to confirm the changes. 

The Use TCF to Enable Google Consent Mode 2.0 setting enables Sourcepoint to set an additional flag when initializing the TCData object. This additional flag allows Google to infer and map consent settings to the following Google Consent Mode 2.0 consent checks based on GDPR TCF purposes:

  • ad_storage
  • ad_personalization
  • ad_user_data

Please see the table below for how Google Consent Mode 2.0 maps GDPR TCF purposes to Google's consent checks:

Purpose Description Google tag behavior when Purpose is denied
1 Store and/or access information on a device ad_storage: denied
ad_user_data: denied
3 Create a personalised ads profile ad_personalization: denied
4 Select personalized ads ad_personalization: denied
7 Measure ad performance

ad_user_data: denied

Disables the Google signals feature in Google Analytics.

9 Apply market research to generate audience insights Disables the Google signals feature in Google Analytics.
10 Develop and improve products Disables the Google signals feature in Google Analytics.

 Note: If your organization utilizes any Google products that require the analytics_storage consent check (e.g. Google Analytics), you will need to perform additional steps. Expand the accordion below for more information.

Google Products using analytics_storage

Sourcepoint's preferred method of implementing Google Consent Mode 2.0 (i.e. the setting of the Use TCF to Enable Google Consent Mode 2.0 flag in Advanced Settings) does not cover the analytics_storage consent check. In this section, we will use Google Analytics as an example to review the additional steps necessary to support analytics_storage using Google Tag Manager. 

  • Configure GTM template for Google Consent Mode 2.0 
  • Add Google product to vendor list
  • Configure custom purpose for analytics_storage

Configure GTM template for Google Consent Mode 2.0

 Sourcepoint GTM Template 

Sourcepoint's GTM template is available directly within Google's Community Template Gallery or as a manually imported template. Please follow the instructions in the link below:

Once Sourcepoint's GTM template is available in your account, navigate to a container and click Tags on the left-hand rail.

Click New in the subsequent panel.

Screenshot 2024-02-26 at 8.04.12 AM.png

Click the Tag Configuration pane and select Sourcepoint CMP - Consent Mode v2 from the modal.

Screenshot 2024-02-26 at 8.07.21 AM.png

By default, all Google consent checks will default to denied (including analytics_storage) for all regions. If this default is acceptable then you can move onto the trigger configuration.

If you would like to change the default settings for any of the Google consent checks, select Add Row and set the default settings for all regions/per region. 

Screenshot 2024-02-26 at 8.15.36 AM.png

Click Triggering and then select Consent Initialization - All Pages from the next page. 

Screenshot 2024-02-26 at 8.18.09 AM.png

Save the tag and when finished click Submit to publish your tag.

Screenshot_2024-02-26_at_8_22_39 AM.jpg

Add Google product to vendor list

From the GDPR TCF vendor list associated with your property, add Google vendors that your organization works with (e.g. Google Analytics).

Screenshot 2024-02-05 at 12.53.38 PM.png

Configure a custom purpose for analytics_storage

Your organization will finally need to create a custom purpose in your GDPR TCF vendor list that maps to the analytics_storage consent check used by the Google product(s) running on your property.

 Google Analytics example

Google Analytics requires the following consent checks:

  • ad_storage
  • analytics_storage

You will need to create a custom purpose for analytics_storage but you do not need to create a custom purpose for ad_storage since that consent check will be set via the Use TCF to Enable Google Consent Mode 2.0 flag you configured earlier.

Click + Add Custom Purpose from the vendor list builder page. Use the provided modal to input a name for the custom purpose. 

Use the Google Consent Mode Category dropdown menu and select analytics_storage. Click Create purpose when finished.

Screen_Shot_2022-06-30_at_1.24.25_PM.png

As a best practice, Sourcepoint recommends that you describe the Google products that currently rely on the purpose.

Navigate to the newly created custom purpose and click the custom purpose name.

Screenshot 2024-02-05 at 3.54.36 PM.png

Use the provided description field to note the Google products utilizing the custom purpose as part of the Google Consent Mode integration. Click Apply changes when finished.

Screenshot 2024-02-05 at 3.56.07 PM.png

Set the legal basis for the custom purpose to User Consent

Screenshot 2024-02-05 at 3.57.32 PM.png

Click Save to confirm the updates to your vendor list. Your Sourcepoint and Google Consent Mode 2.0 integration setup is complete. 


Debug default consent mode timing

Your organization can add the following code snippet to Sourcepoint's onConsentReady event callback to check whether the default consent code is set before any other Google product is configured.

If any other Google product is configured before Google Consent Mode code is set then you will receive the following alert in your browser console: GCM not being configured soon enough.

onConsentReady: function (consentUUID, euconsent) {
    console.log('[event] onConsentReady', arguments); 
    //Loop through all the dataLayer objects
      for(var obj in dataLayer){
        //initialize vars
        gcm_conset_pos = -1;
        gcm_config_pos = -1;
                        
        //mark when GCM is first set
        if(dataLayer[obj][0]==='consent'){                   
          console.log('GCM configured at position ' + obj + ' in the data layer');
          if(dataLayer[obj][1]==='default'||dataLayer[obj][1]==='update'){
            var gcm_conset_pos = obj;    
          }
        }
                        
        //mark when the first Google product is configured
        if(dataLayer[obj][0]==='config'){
          console.log(dataLayer[obj][1] + ' configured')
          var gcm_config_pos = obj;
          console.log("breaking: ", (gcm_conset_pos - gcm_config_pos));
          break;
        }
      }
                    
      //check if GCM is happening before any config is happening
      if((gcm_conset_pos - gcm_config_pos)0){
        console.log("GCM not being configured soon enough")
      }
      else{
        console.log("GCM timing is okay")
      }
}

Test integration

Regardless of how your organization has implemented Google Consent Mode 2.0 (either via Google Tag Manager or gtag.js, using the preferred method or without the flag), you can test the setting of Google's consent checks via Google Tag Assistant. 

 Google Tag Assistant

Click Add Domain.

Screenshot 2024-02-12 at 2.30.05 PM.png

Use the provided modal to input your property's URL that is currently integrated with Sourcepoint's CMP and Google Consent Mode 2.0.

Screenshot 2024-02-12 at 2.33.20 PM.png

From an event, navigate to the output for your container/tag and select the Consent tab. From the subsequent table, you can discern the status of the Google consent checks and compare them to consented/rejected purposes in your privacy manager.

Screenshot_2024-02-12_at_2_47_54 PM.jpg

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.