Cookie with multiple values - how to set one in an Adobe Analytics variable

Gold Contributor
Gold Contributor
We have values set in a cookie: utag_data.cp.currentUser = {"email":"pheavey@gmail.com","is_advantage_member":false,"first_name":"Patrick"... Want to set the value of "is_advantage_member" to a SC variable. Thanks.
8 REPLIES 8

Cookie with multiple values - how to set one in an Adobe Analytics variable

Tealium Employee
(Edited to remove typo) If you add the SC variable as a UDO data source in the data layer, then set it using a set data values extension, set to jscode of something like utag.data["cp.currentUser"].split(",")[1].split(":")[1]; Which isn't the tidiest but should do the trick. You can then map it to SC accordingly.
Connecting data systems since the 1980s.

Cookie with multiple values - how to set one in an Adobe Analytics variable

Gold Contributor
Gold Contributor
This seemed to have completely broken the utag.

Cookie with multiple values - how to set one in an Adobe Analytics variable

Moderator
Moderator
Hi Patrick, It looks like Steve's code had an extra period at the end of the statement, just before the semicolon - perhaps that's why it didn't work? Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Cookie with multiple values - how to set one in an Adobe Analytics variable

Tealium Employee
I'm very sorry about that, I'm not sure how the extra character got in there. I have edited the above post to prevent any future problems.
Connecting data systems since the 1980s.

Cookie with multiple values - how to set one in an Adobe Analytics variable

Gold Contributor
Gold Contributor
I made the change as above, but the value passed in the SC variable is "false".

Cookie with multiple values - how to set one in an Adobe Analytics variable

Tealium Employee
You presumably want it to be false, without the quotes?
Connecting data systems since the 1980s.

Cookie with multiple values - how to set one in an Adobe Analytics variable

Gold Contributor
Gold Contributor
Sorry, my bad - there are no quotes. I had in my head that the value should be something different, but "false" is correct. Thanks for your help!

Cookie with multiple values - how to set one in an Adobe Analytics variable

Tealium Employee
Ah, that's good - I'm glad that it's working. Thanks.
Connecting data systems since the 1980s.
Public