Add support for Google consent mode v2

Created on 9 January 2024, 10 months ago
Updated 8 March 2024, 8 months ago

Problem/Motivation

Cookie information has added support for Google consent mode v2.

There is a support article for the upgrade process at https://support.cookieinformation.com/en/articles/8707953-how-to-update-....

We already have existing support for v2 and we could add the needed changes for v2.

Proposed resolution

We need to add the new attribute to the script:

<script id="CookieConsent" type="text/javascript" data-culture="EN" src="https://policy.app.cookieinformation.com/uc.js" data-gcm-version="2.0"></script>

Source code: https://git.drupalcode.org/project/cookieinformation/-/blob/2.0.x/cookie...

We already have the advanced script tag in place which we need to upgrade:

<script> 
   window.dataLayer = window.dataLayer || []; 
   function gtag(){ dataLayer.push(arguments); } 
   // Set default consent to 'denied' as a placeholder 
   // Determine actual values based on customer's own requirements 
      gtag('consent', 'default', { 
      'ad_storage': 'denied', 
      'ad_user_data': 'denied', 
      'ad_personalization': 'denied', 
      'analytics_storage': 'denied', 
      'wait_for_update': 500 
      }); 
  gtag('set', 'ads_data_redaction', true); 
</script> 

Source code: https://git.drupalcode.org/project/cookieinformation/-/blob/2.0.x/js/con...

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇮Finland heikkiy Oulu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024