Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-7410

Update the default and update consent mode scripts

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Merged
    • Icon: Should have Should have
    • 2.128.0
    • None
    • 3
    • Analytics
    • Sprint #232, Sprint #233, Sprint #234
    • venus

      Summary

      The current Planet 4 consent management system needs to be modified and implemented to properly manage the consent mode. 

      Issues:

      1. The logic of the script needs to be changed. Today, we call the default consent once the user lands on the page, and then we call the update consent with the user new preferences every new page. Instead, we should call the default consent once the user lands on the page, the update consent when they interact with the cookies bar, and then we should keep calling the default consent on the following pages with their updated preferences.
      2. The Consent Mode v2 was released last year and introduced new parameters which needs to be implemented on Planet 4 consent management system

      Requirements

      Task #1: Include new variables on the Consent Mode script

      This task has been added in a previous ticket but you can choose to merge them if it's better.

       

      Task #2: Update the default and update consent mode scripts

      As mentioned above, the logic of the Consent Mode script needs to be changed, we need to fix the behavior of the default and update consent. 

      CONSENT DEFAULT

      For the default consent setting, we have two distinct scenarios: 

      Case 1 - The user has not made any consent choice (navigation with the banner open). 

      When the user lands on the site and the consent choice banner is displayed, the following script should be executed: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'default', { 
      analytics_storage: 'denied', 
      ad_storage: 'denied', 
      ad_user_data: 'denied', 
      ad_personalization: 'denied' 
      }); 
      gtag('set', 'url_passthrough', true); 
      gtag('set', 'ads_data_redaction', true);
      

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage).

      Case 2 - The user has already made a choice previously (navigation with the banner closed). 

      When the user continues navigation (i.e., on page load), the following script should be executed, with the various parameters set according to the consents given, retrieving them from the cookies: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'default', { 
      analytics_storage: 'granted', 
      ad_storage: 'denied', 
      ad_user_data: 'denied', 
      ad_personalization: 'denied' 
      }); 
      gtag('set', 'url_passthrough', true); 
      gtag('set', 'ads_data_redaction', true); 
      

       

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage). 

       

      CONSENT UPDATE

      The consent update should be executed in four distinct scenarios: 

      Case 1 - The user accepts all cookies (Accept all cookies button). 

      When the user accepts all cookies, execute the following script: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'update', { 
      analytics_storage: 'granted', 
      ad_storage: 'granted', 
      ad_user_data: 'granted', 
      ad_personalization: 'granted' 
      }); 
      gtag('set', 'ads_data_redaction', false); 
      

       

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage). 

      Case 2 - The user rejects all cookies 

      When the user rejects all cookies, execute the following script: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'update', { 
      analytics_storage: 'denied', 
      ad_storage: 'denied', 
      ad_user_data: 'denied', 
      ad_personalization: 'denied' 
      }); 
      gtag('set', 'ads_data_redaction', true); 
      

       

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage). 

       

      Case 3 - The user customizes their consents (Settings button). 

      When the user customizes their consent choices, execute the following script, with the various parameters set based on the consents given: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'update', { 
      analytics_storage: 'granted', 
      ad_storage: 'denied', 
      ad_user_data: 'denied', 
      ad_personalization: 'denied' 
      }); 
      gtag('set', 'ads_data_redaction', true); 
      

       

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage). 

      Case 4 - The user modifies consents from the /privacy page. 

      When the user modifies their consent choices, execute the following script: 

       

      window.dataLayer = window.dataLayer || []; 
      function gtag() { window.dataLayer.push(arguments); } 
      gtag('consent', 'update', { 
      analytics_storage: 'granted', 
      ad_storage: 'denied', 
      ad_user_data: 'denied', 
      ad_personalization: 'denied' 
      }); 
      gtag('set', 'ads_data_redaction', true); 
      

       

      Note that the parameters ad_user_data and ad_personalization should be set according to the consent provided for the Marketing category (ad_storage). 

       

      Resources

        1. screenshot-1.png
          581 kB
          Julia Marubayashi

            sdeshmuk Sagar Deshmukh
            jmarubay Julia Marubayashi
            Julia Marubayashi Julia Marubayashi
            Florent Hernandez Florent Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: