Setting cookie value dynamically based on element value | Community
Skip to main content
ScottSweeney-sg
March 8, 2017
Solved

Setting cookie value dynamically based on element value

  • March 8, 2017
  • 3 replies
  • 1436 views

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);

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Løjmann

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

3 replies

Løjmann
LøjmannAccepted solution
Level 5
March 8, 2017

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

bill_tripple1
Level 2
March 8, 2017

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

jantzen_b
Adobe Employee
Adobe Employee
March 9, 2017

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?