OneTrust Implementation in Adobe Launch

OneTrust Implementation in Adobe Launch

OneTrust offers a comprehensive platform to help businesses achieve and maintain compliance with the California Consumer Privacy Act (CCPA), General Data Protection Regulation (GDPR) and other privacy related regulations across the world.

This is my first collaboration piece, working with Andrew to explore OneTrust. Post from Andrew can be found here.

In this post, I have shared my experience of OneTrust integration with tag management solution adobe launch, but conceptually this would work similarly on other TMS like Google Tag Manager(GTM) etc. During the implementation of oneTrust we faced a few problems and this post shares technical details about how we overcame those problems. Any suggestions or feedback, please comment below.


Problem statement 1 : When different pages of a website are maintained by the different dev teams, there have been a few cases where oneTrust library is not present on some of the pages. As a result, we can’t fully rely on JavaScript variable OnetrustActiveGroups to determine the consent status.

Solution 1: Check for OptanonConsent cookie if JavaScript variable OnetrustActiveGroups is not available.


Problem statement 2 : On some pages, OptanonConsent cookie is set at a particular path ( such as /abcd/def ) instead of all path ( / ). Let’s say the user lander on www.site.com/path1 and denies the consent, then the user goes to page www.site/com/path2 which doesn’t have oneTrust library. Now we don’t have JavaScript variable OnetrustActiveGroups as well and we can’t access OptanonConsent cookie as the cookie path is different.

Solution 2: Clone OptanonConsent cookie to ck_OptanonConsent_fallback cookie and set path as all path (./)


Problem statement 3 : OptanonConsent cookie is set at the subdomain level instead of the parent domain level. Let’s say the user lander on www.site.com/path1 and denies the consent which sets the OptanonConsent cookie at domain .www.site.com , then the user goes to www.subdomain.site.com which doesn’t have oneTrust library. Now we don’t have JavaScript variable OnetrustActiveGroups as well and we can’t access OptanonConsent cookie as the cookie subdomain is different.

Solution 3: Clone OptanonConsent cookie to ck_OptanonConsent_fallback cookie and set domain as dot parent domain (.site.com)

While discussing with Andrew, he suggested that there is also an option available in oneTrust admin configuration to set the cookie at the subdomain level instead of the parent domain. However, by default, this is turned off. Isn’t it strange why oneTrust has kept this off by default, and it’s not easy to locate this setting?


Problem statement 4 : Intermittently oneTrust sets JavaScript value of OnetrustActiveGroups as an empty string with just commas (‘,,’) for a few milliseconds before it populated with actual group value (such as ‘,C0001,C0002,C0003,C0004,CADNS’). Empty groups give false positive results of consent status.

Solution 4: Skip JavaScript OnetrustActiveGroups if it contains an empty string with commas, and validate the next check i.e OptanonConsent cookie.


Problem statement 5 : User lands on the first page which doesn’t have oneTrust library. Now we don’t have JavaScript variable OnetrustActiveGroups, nor cookie OptanonConsent to determine consent status.

Solution 5 : Have fallback hardcoded default consent status based on CCPA/GDPR etc privacy laws.


Problem statement 6 : OneTrust loads on a site with delay as a result OptonWrapper is not fully reliable for tracking changes in consent and triggering Adobe launch rule or Google tag manager tags.

Solution 6 : Attach a listener to page load event, that would have DirectCall trigger in adobe launch when OptonWrapper function is not available on the page.


The site I used had both Adobe Launch for Adobe Analytics, and Google Tag Manager for Google Analytics as well as Media Analytics (Third party tracking)\

List of business and technical requirements when consent is denied.

1) Block Adobe Analytics { CADNS value or OptIn status used to block }

2) Block Google Analytics { CADNS value or OptIn status used to block }

3) Block Media Analytics { CADNS value or OptIn status used to block }

4) Implement consent V2 in GTM {not converted in this article}

5) Implement ECID optIn service at runtime {not converted in this article}

6) Delete ECID and other adobe cookies

Implementation Details

1) Create a DataElement name ‘OnetrustActiveGroups’

  • first check for JavaScript variable OnetrustActiveGroups
  • second check for cookie OptanonConsent and extract groups information
  • third check for fallback cookie ck_OptanonConsent_fallback and extract groups information
  • forth default fallback hardcoded consent

Note: This code be optimized by creating a function to extract groups from cookie

2) Create a dataElement ‘cc_OneTrust_Consent_status’ to return OptIn/OptOut status, so it can be used for props/evar or any other variable etc

return _satellite.getVar("OnetrustActiveGroups").includes('CADNS') ? 'opt-in' : 'opt-out';          

3) Create a pageTop rule in launch that would during optOut

  • delete the adobe cookies
  • update cookie ck_oneTrustGTMconsent for the GTM consent V2 purpose
  • triggers the GTM datalayer event launch_optonWrapper
  • attach listener at load event that triggers DirectCall when optonWrapper is not available.

We intentionally created cookieListDoDelete as an object having key (CADNS) from the consent groups. So if in future, if we have to delete different sets of cookies based on each consent group, and then we just have to update cookieListDoDelete variable. This is added complexity and not required as per current requirement, but we kept it to make it future-proof.

4) Create a DirectCall rule in launch that would do exactly same as pageTop rule, when optonWrapper function is not available due to the delay or any other reason.

Note: this rule is very similar to previous rule, with few minor difference. They can be merged to optimize the code.



#googleanalytics #googletagmanager

#adobeanalytics #gdpr #ccpa #oneTrust #cookiecompliance

#continouslearning #learningeveryday

Will England

Analytics, Data Insights, System and Program Analyst for all things Digital

8 个月

Quality information. I just went through a OneTrust implementation with a major client in Canada and ran into many of the same things you bring up; your solution is solid and more robust than we delivered. Nice work!

Dustin Wallace

Simplifying and Automating Marketing Tag QA

8 个月

Don't forget to add a tag monitoring platform to the mix to actively monitor your site for consent violations! ??

This is great! I like the Cookie Delete list, though I really hope that enver does become a requirement (I could only delete first party cookies this way, not third party). For #2 and #3- FWIW, I believe (though I could be wrong) that the cookie domain and path are decided in the oneTrust interface when setting up domains. The problem is, I don't think you can change it after the initial set up- to start getting our cookies set at .domain.com instead of www.domain.com, we had to create a whole new domain in the onetrust UI.

Pradeep Jaiswal

Solution Architect | Adobe AEP, RT-CDP, CJA, AJO, Analytics, Target

9 个月

要查看或添加评论,请登录

Pradeep Jaiswal的更多文章

  • Adobe AEP-CDP-WebSDK Implementation WhatsApp Group

    Adobe AEP-CDP-WebSDK Implementation WhatsApp Group

    Knowledge is like money, to be of value it must circulate, and in circulating it can increase in quantity and…

    47 条评论
  • ADOBE ANALYTICS ARTICLE/POST INDEX

    ADOBE ANALYTICS ARTICLE/POST INDEX

    Over the years, I have read a few articles/posts related to Adobe Analytics to upgrade my knowledge. I consistently…

    26 条评论
  • Anomaly detection - Non programming way

    Anomaly detection - Non programming way

    I was once asked, how to determine anomaly/outlier in data set without using any analytical tool or programming…

    11 条评论
  • Visitor Retention Analysis using Calculated Metric Function

    Visitor Retention Analysis using Calculated Metric Function

    After getting inspired by Adam Greco blog & Piermarco Burrafato article, I decided to play around and try to recreate…

    24 条评论
  • Adobe Analytics Professional & Recruiters

    Adobe Analytics Professional & Recruiters

    Knowledge is like money, to be of value it must circulate, and in circulating it can increase in quantity and…

    287 条评论
  • Abuse of 'Reply to All' ..!!

    Abuse of 'Reply to All' ..!!

    Either people don’t know what reply all is, or social networks have convinced them that broadcasting is the only…

    2 条评论

社区洞察

其他会员也浏览了