Adobe Target and OneTrust | Community
Skip to main content
August 22, 2024
Question

Adobe Target and OneTrust

  • August 22, 2024
  • 1 reply
  • 1416 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

abhinavpuri
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 23, 2024

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?

LucaVi3Author
August 26, 2024

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?

Amelia_Waliany
Adobe Employee
Adobe Employee
October 31, 2024

Thank you for posting your question here @lucavi3 🙂 And thank youfor weighing in! @lucavi3 were you able to resolve the issue? If so, please feel free to share any updates or follow up Qs here by Replying to the thread so that others with similar issues can refer to your approach 👀

 

Otherwise  @abhinavpuri do you have any other suggestions here? Thanks!