How does data variable set in data layer utag.data persist across pages?

Bronze Contributor
Bronze Contributor

Hi, 

I'm still wrapping my head around the data layer and how data persists. If we setup a data variable to be captured in our data layer, will we be able to use that variable in any extension in tealium, or do we need to code it to pass the variable on every page that we want the extension to fire on? 

For example, take an order_id which we generate as soon as someone hits the "checkout button" and pass to our data layer via utag.data. We don't want to send this order_id to our media partners, until someone has actually purchased something (several pages later, after entering credit card, shipping, confirmation, etc.). Given this, do we need to capture the order_id in utag.data on every page after checkout (i.e. credit card page, shipping, confirmation) or can we capture the order_id in utag.data only the first time we generate it (at checkout) and then set an extension in tealium to only pass that order_id to our media partners when they land on the confirmation page? 

Thanks!

 

 

 

1 REPLY 1

How does data variable set in data layer utag.data persist across pages?

Tealium Expert
Tealium Expert

Hi @eclark

There are two ways: 

As you pointed out, the value can me made visible in the UDO on each page and used when requried. This will require your devs to make this happen. 

If on the other hand, the former is no possible, then you can 'persist' a value to subsequent pages. There is an extention ready made to do this, and all it does is drop a cookie, which you can then pick up when you need... 

Hope that helps. 

Gavin

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -
Public