- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
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.
12-11-2018 02:37 AM - edited 12-11-2018 02:38 AM
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
Copyright All Rights Reserved © 2008-2023