- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
01-22-2020 08:50 AM
I am about to add cookie consent banner to my site, I found some cookies from adobe are getting fired even I apply the load rules for all the tags. I think it is because I implemented adobe target in utag.sync.js and I don't have a target tag to add the load rule. Is it possible to add cookie consent to target implemented through utag.sync.js? or do I need to implement target as a tag to add load rules of cookie consent?
Can someone give me your thoughts. Thanks in advance
Solved! Go to Solution.
01-24-2020 09:49 AM
If you are adding the tag through utag.sync the script will be running . too early to rely on utag functions.
However you can wrap the target tag within an if statement which checks for the cookie itsself - something like this.
var consent_cat = "c1"; function readCookie(name) { return (name = (document.cookie + ';').match(new RegExp(name + '=.*;'))) && name[0].split(/=|;/)[1]; } var consent = readCookie("CONSENTMGR"); if (typeof consent !== "undefined" && (consent.indexOf(consent_cat + ":1") > -1 || consent.indexOf("consent:true") > -1)) { // ADOBE TARGET SCRIPT }
updating "conset_cat" to whichever category in the CONSENTMGR you want to check
If you aren't using our built in consent manager, you can adapt the code accordingly to work with whatever cookie gets set.
08-05-2020 11:18 PM
Hi. But this only works for the synchronous version of Adobe Target which is injected through the utag.sync.js directly and not via tag, right?
Has anyone managed to make it work with the asynchronous tag? I experience the 3s white page because the required Adobe Target Content Modification extension which injects the hiding CSS in the utag.sync.js apparently always fires and if the user has opted out of - in my case - the personalization category, the tag will never fire and the hidden content will only show when the content hide timeout from the utag.sync.js happens.
Does not seem like the Content Modification extension can be extended with conditions like in other extensions.
Cheers
Björn
08-11-2020 02:40 AM
06-21-2022 07:12 AM - edited 06-21-2022 08:00 AM
Ignore my previous post, didn't read properly.
Copyright All Rights Reserved © 2008-2023