Highlighted

How do I read/access the UDO values in utag.sync

Silver Contributor
Silver Contributor

We have implemented Target via Utag.sync now we need to pass custom parameters to Target. How do we pass/read the UDO value in utag.sync. is it possible or is there any work around for it.

 

Thanks!

3 REPLIES 3
Highlighted

How do I read/access the UDO values in utag.sync

Employee Emeritus

Hi @madhan_v,

The utag_data object would need to be referenced before utag.sync.js.  If this is the case, you would simply access the data layer elements by typing the following into utag.sync.js

 

utag_data["key_name"]

Please note that the utag_data object won't include the automatic data points such as first party cookies because utag.js hasn't run yet.  The utag.js library adds these data points once it has loaded.

Highlighted

How do I read/access the UDO values in utag.sync

Silver Contributor
Silver Contributor

Thanks Jason.

 

But utag.sync is in head and utag_data object is in body. I believe its a differnet scenario than what you had mentioned. Is there any work around??

 

Thanks!

Highlighted

How do I read/access the UDO values in utag.sync

Employee Emeritus

Hi @madhan_v,

You would need to move the utag_data code into the head before referencing utag.sync.js.  If utag.sync.js is loaded before utag_data, utag.sync.js can't see utag_data.  

 

Keep in mind that you don't need to define the whole utag_data object before referencing utag.sync.js.  You only need to include the data points needed for utag.sync.js.  The remaining data points can be added to utag_data in the body before referencing the main utag.js library.

 

Let us know if there are any other questions.