- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
09-06-2016 02:55 AM
Based on a visitors cookie-consent level we launch Google Analytics with or without the displayfeatures. If you turn it on Tealium will load:
ga("require", "displayfeatures")
But if you turn it off Tealium will load nothing and Google Analytics listens to the property settings. There you can turn it on/off also.
I change to Google Analytics Tealium template from:
if (u.data.displayfeatures === "true" || u.data.displayfeatures === true) { u.all("require", "displayfeatures");
to:
if (u.data.displayfeatures === "true" || u.data.displayfeatures === true) { u.all("require", "displayfeatures"); } else { u.all("set", "displayFeaturesTask", null); }
To ensure the displayfeatures are always turned on or off in the script so the property setting are overriden. So far so good. But if you fire an event after 15 seconds with the utag.link function:
utag.link({ gua_ec: "category", gua_ea: "action", gua_el: "label", gua_ni: true })
Tealium creates a new GA tracker (which is ignored, cause the tracker already exists) and sets the following line:
ga("require", "displayfeatures")
Even when the displayfeatures are turned off?
How is this possible? Looks like a bug?
My solution for now is to change:
if (u.data.displayfeatures === "true" || u.data.displayfeatures === true) { u.all("require", "displayfeatures"); } else { u.all("set", "displayFeaturesTask", null); }
to:
u.all("set", "displayFeaturesTask", null);
to make sure the're always turned off unregarding the option you selected in the Tealium GA settings.
09-06-2016 03:02 AM
After debugging for 2 hours I posted the post above, and 5 minutes later I see that the cookieconsent cookie is magically updated after a few seconds. That's causing that the event after 15 seconds has displayfeatures on.
So the only thing that stays is the displayfeaturestask line to turn of the features hardcoded in stead of listening to the property settings.
09-07-2016 03:12 AM
I have raised an enhancement to get this updated for you.
Adrian
09-17-2019 01:26 PM
Do we have slolution for this? I am using analytics.js
Copyright All Rights Reserved © 2008-2023