Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Setting cookie value dynamically based on element value

Avatar

Level 1

Being able to dynamically set a cookie value based on an element's value seems like a no-brainer as you can inject it into s.products but I see no documentation and my attempts have failed.

Example of what seems overly simplistic, but at least to me, should work;     _satellite.setCookie('source','ELEMENT VALUE',1);

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi Scott,

Have a look at https://marketing.adobe.com/resources/help/en_US/sc/implement/util_cookiewrite.html

If you are running AppMeasurement.js you can use that build-in function to write your cookies...

/Løjmann

CM EDIT: Added hyperlink to text

View solution in original post

3 Replies

Avatar

Correct answer by
Level 6

Hi Scott,

Have a look at https://marketing.adobe.com/resources/help/en_US/sc/implement/util_cookiewrite.html

If you are running AppMeasurement.js you can use that build-in function to write your cookies...

/Løjmann

CM EDIT: Added hyperlink to text

Avatar

Level 2

 _satellite.setCookie('source','ELEMENT VALUE',1) should work fine

Avatar

Level 10

Hi Scott,

When you use 

_satellite.setCookie('source','ELEMENT VALUE',1);

What is happening? Have you used 

_satellite.getVar('DATA ELEMENT NAME');

to verify that the data element you are trying to use to set the cookie has a value?