Use this Extension to save, or persist, a variable's data in a cookie of your choice for whatever duration you specify. This was previously known as the Persist Variables Extension.
1. In Tealium iQ, navigate to the Extensions tab and add the Persist Data Value Extension, located under the Standard Data tab of the Extensions marketplace.
2. Enter a title for the Extension.
3. Choose the scope for this Extension, either a specific Tag or 'All Tags'.
If you decide to scope to All-Tags, you can also choose when to execute the Extension (Requires utag.js version 4.38 or higher; older versions may cause Extension to run more than once)
4. From the 'Persist' drop-down list, select either 'Text' or 'Variable'.
5. From the 'Duration' drop-down list, select the length of time that the data will persist in the cookie.
6. From the 'Update' drop-down list, select when the value is to be replaced or updated.
7. Click the 'Add Condition' button to specify when to run this Extension. You may only add one condition.
8. From the 'Store in Cookie' drop-down list, select the cookie you want to store the variable's data in. If you do not have a cookie variable ready, click the plus button to create a new cookie variable.
9. Save and Publish.
You can store the data in the Tealium-provided cookie, utag_main, or in a 1st-party cookie from the originating site. If you wish to store the value in Tealium's utag_main cookie, create a new cookie variable 'utag_main_<name>, where <name> is the cookie value you wish to add to the utag_main cookie. Make sure this new cookie variable, utag_main_<name>, is listed in the Variables tab so the system can recognize and write to it.
We will go through a simple use case to provide some clarity.
In this scenario, we want to persist the visitor's location, namely the city, state, and zip code they originated from. This information is stored in a variable called 'city_state_zip'.
When the page loads your data, it will be saved in the utag_main cookie as:
$location:Los Angeles CA, 90010;exp-session
The '$' signifies a new cookie value, in this case the new cookie value is 'location'. The colon after location signifies the beginning of the variable's value, which is 'Los Angeles CA, 90010'. The semicolon delimits the end of the variable's value from the duration expiration, which we set to 'Session'.