Google Analytics not listening to displayfeatures setting

AndreScholten
Gold Contributor
Gold Contributor AndreScholten

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.

Freelance Web Analist
3 REPLIES 3
Highlighted

Google Analytics not listening to displayfeatures setting

AndreScholten
Gold Contributor
Gold Contributor AndreScholten

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.

Freelance Web Analist

Google Analytics not listening to displayfeatures setting

Tealium Employee

@AndreScholten

 

I have raised an enhancement to get this updated for you.

 

Adrian

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Google Analytics not listening to displayfeatures setting

priybrat1980
Bronze Contributor
Bronze Contributor priybrat1980

Do we have slolution for this? I am using analytics.js