Reply
Highlighted
Visitor
Posts: 1
Registered: ‎06-19-2017

utag_data and utag.data

What's the diference between utag_data and utag.data?

Thanks!

Reply
0 Kudos
Occasional Contributor
Posts: 120
Registered: ‎12-11-2015

Re: utag_data and utag.data

It depends...

If window.utag_data exists prior to utag.js being loaded (as per best practice) then there is no difference between them - utag.data is initialised as a reference to window.utag_data and consequently changes to either are reflected in the other. The code that does that is here:

utag.data = (typeof utag_data != 'undefined') ? utag_data : {};

If window.utag_data is initialised after utag.js is loaded, it gets a bit trickier.. There is a function (utag.loader.WQ) that merges the contents into utag.data, but in that case it's only copies of the data item rather than a direct reference, and I forget now under which circumstances it fires. Suffice it to say, your experience of Tealium will be more straightforward if utag_data is always initialised before loading utag.js.

Contributor
Posts: 67
Registered: ‎04-20-2016

Re: utag_data and utag.data

[ Edited ]

Hi @yan_almeida

Additionally to what @UnknownJ says:

utag_data is (usually) declared on the page, and (usually) contains stuff set by the developers from the server

utag.data is the processed data layer. 

This contains everything from utag_data...
plus any DOM stuff (properties prefixed with "dom." such as utag.data["dom.url"])
plus any cookie values (properties prefixed with "cp.")
plus any page JS variables you may have declared
plus any querystring parameters (properties prefixed with "qp.")

Also utag.data will have had any extension manipulation code applied

Checkout our blog: www.120feet.com/blog
Reply
0 Kudos