persist data value don't works with variables

Bronze Contributor
Bronze Contributor



I want to save variable to cookie from data layer, but it saves cookie with [undefined] value.

The data was stored to [] variable by inline script in the [Modal offer] extension.

I created [Persist Data Value] extension to store this value in cookie, but it can save only text.



persist data value don't works with variables

Employee Emeritus

Hello @asdfcgvbh. Do you have a URL where we can see the error? Or perhaps a screenshot. We look forward to your reply. 

Remember to give me a kudo if you like my post! Accepting my post as a solution is even better! Also remember that search is your friend.

persist data value don't works with variables

Employee Emeritus

Hello @asdfcgvbh, what scope does your Persist Data Values extension have?

By default, it will have a scope of "All Tags" while the Modal Offer extension has the scope of DOM Ready. In this scenario, the Persist extension will run prior to the Modal Offer extension so the data source value you are trying to store is not available yet.


One option would be to change your inline script in the modal extension to take the tmo_dontshow_checkbox data source value and store it in the utag_main cookie namespace:


utag.loader.SC("utag_main", {myVar:"exp-session"}); //myVar persists for the current session

utag.loader.SC("utag_main", {myVar:}); //myVar persists for the life of utag_main

 Either of the above methods will store your value in the utag_main cookie name space.

  • utag.loader.SC is built-in cookie setting method for utag.js -- more info here
  • "utag_main" is the Tealium cookie namespace - we recommend using this to mitigate the against the browsers' cookie limit
  • "myVar" is the container/key for the value you want to store
  • is the data source containing the value you want to store in utag_main
  • exp-session (optional) sets the lifetime of myVar