Expand my Community achievements bar.

Block cookies automatically dropped by Launch

Avatar

Level 1

Greetings.

 

I'm having a dickens of a time trying to stop cookies like "mbox", "s_sq", "s_plt", "s_pltp", and others from dropping upon the loading of Adobe Launch in a website before the user selects whether they wish to use cookies through OneTrust. It looks like the cookies are created and dropped when the minified Launch JS file is loaded from adobedtm. The Launch JS is necessary for the page to run properly from the outset, so I just need to stop the cookies from dropping. If anyone has any recommendations, I'd love to hear them.

Topics

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

4 Replies

Avatar

Community Advisor

@atarian2049  are you implemented analytics tracking websdk or AppMeasurement.js? 

 

you can use below code 

adobe.optIn.denyAll();
var consentlist= window.OnetrustActiveGroups;

if(consentlist){
if (consentlist.indexOf(",C0002,") > -1 ) {
adobe.optIn.approve(adobe.OptInCategories.ANALYTICS,true);
adobe.optIn.approve(adobe.OptInCategories.TARGET,true);
adobe.optIn.approve(adobe.OptInCategories.ECID,true);
adobe.optIn.complete();
}
}

Amruthesh_AG_0-1763633183293.pngAmruthesh_AG_1-1763633199189.png

 

Avatar

Level 1

I'm using AppMeasurement.js (along with VisitorAPI and MediaSDK). Is the OT Check a custom code block as well? I don't see that as a standard condition type. I'm guessing the custom code in the actions is where you implemented the written code above the images, correct?

Avatar

Level 1

Also, wouldn't the cookies have already dropped just from using the Launch JS file by the time it gets to the rules in the code?

Avatar

Community Advisor and Adobe Champion

@atarian2049 , the Visitor ID Service comes with an opt-in API that can be used to control which of the legacy Adobe libraries (Target, Analytics and Audience Manager) are alloed to fire.

Internally, it uses a queue that, once consent is granted, is released, so that you do not lose tracking calls on the same page.

 

Check out this - slightly old but still valid - blog post by Jan Exner: https://webanalyticsfordevelopers.com/2021/02/16/consent-and-launch/ which explains step by step which settings to apply on the Visitor ID extension. As @Amruthesh_AG mentioned above, it is crucial to have a data element in place that picks up the (if applicable) previously given consent.

 

One word of notice: I would omit using the 

window.OnetrustActiveGroups

which I have seen running into race conditions where a given consent was not written into that window scoped variable by the time Launch executed and led to missed tracking calls.

Instead, I would always read out the cookie yourself, in that case checking for the category followed by a ":1" e.g., "C0002:1" for the standard performance/analytics category.

bjoern__koth_0-1763672928647.png

 

More documentation on the opt in service can be found here

https://experienceleague.adobe.com/en/docs/id-service/using/implementation/opt-in-service/optin-over... 

Cheers from Switzerland!