Expand my Community achievements bar.

Adobe Target and OneTrust

Avatar

Level 1

Hello,

I am new to Adobe Target and need to implement a deployment on a landing page that uses OneTrust and Google Tag Manager.

I have deployed Adobe Target and can successfully run experiments. However, I am struggling to find a way to have Adobe Target modify the page while delaying data collection until OneTrust signals that user consent has been given.

 

What steps should I take to make data collection conditional on the consent signals from OneTrust?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Level 5

Hi @LucaVi3 ,

Can you please share more details on the above setup? Is the goal to render Adobe Target once user have provided consent using OneTrust?

Avatar

Level 1

Hi @abhinavpuri ,

 

The goal here is to make sure that no data is collected when the user is denying consent with OneTrust.

Here is the sequence of events on a landing page, assuming that the visitor lands on the website for the first time.
1) visitor lands on the page

2) during page load AT is modifying the page to set up the experience for the A/B test

3) data is sent to Adobe to notify the page view to Adobe Target

4) OneTrust banner appears on the page

Now, if the visitor is denying tracking, we have a problem as we already sent data to Adobe Target. Under the strict interpretation of GDPR this is not acceptable. So what I need to do, is to delay sending data to Adobe Target until consent is given. At the same time I need to load the experience of the A/B test before everything else.
In my setup, at.js is harcoded on the page. 

At the end of at.js I have appended the following code, to send a datalayer push to know exactly when Adobe Target fires:

 

  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push(
  {  
    'event': 'adobeTargetFired'
  });

  document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function (e) { 
 
    var tokens=e.detail.responseTokens; 
 
    if (isEmpty(tokens)) { 
      return; 
    } 
     
    var uniqueTokens = distinct(tokens); 
 
    uniqueTokens.forEach(function(token) { 
      window.dataLayer.push({ 
        'event': 'adobeTargetExperimentTokens',
        'targetActivityName': token["activity.name"], 
        'targetActivityId' : token["activity.id"], 
        'targetExperienceName': token["experience.name"], 
        'targetExperienceId': token["experience.id"], 
        'targetOfferId': token["offer.id"], 
        'targetOfferName': token["offer.name"], 
        'targetMboxName': e.detail.mbox}); 
    }); 
  }); 
 
  function isEmpty(val){ 
    return (val === undefined || val == null || val.length <= 0) ? true : false; 
  } 
 
  function key(obj) { 
     return Object.keys(obj) 
    .map(function(k) { return k + "" + obj[k]; }) 
    .join(""); 
  } 
 
  function distinct(arr) { 
    var result = arr.reduce(function(acc, e) { 
      acc[key(e)] = e; 
      return acc; 
    }, {}); 
   
    return Object.keys(result) 
    .map(function(k) { return result[k]; }); 
  }


Do you have any suggestions?