Marketing Automation - Contact Property from Cookie

Leigh Chilcott asked on May 9, 2016 19:56

Is is possible to set a contact property (via marketing automation) from a value which has been previously cookied?

I've tried this in marketing automation and by step to set the value (i.e. setting the property value to {% Cookies["Cookie name"] #%}) never gets hit because the previous step to check if the cookie exists (i.e. Cookies["Cookie Name"] != null) always returns false

Recent Answers


Trevor Fayas answered on May 9, 2016 22:14

Cookies can be a bit problematic i've found, but here's some things to check to try to diagnose the issue.

  1. Check your browser and see if indeed the cookie is being set. If the cookie is not in the browser, that would be the first issue and i would see how the cookie is being set.
  2. Check through a custom script to see if the cookie is getting to the website, sometimes cookies have domain issues or expiration issues. If you can confirm the cookie is making it to the server, then that's good.
  3. Make sure your cookie data isn't too large (there are limits, but i doubt you'll be pushing them).

How are you currently setting cookies?

0 votesVote for this answer Mark as a Correct answer

Leigh Chilcott answered on May 9, 2016 22:23

Hi Trevor,

Cookies are being set via JavaScript. I've checked with via the browser that the cookies are indeed being set and that the cookies are being set against the correct domain and are being set as session cookies. I have also confirmed that the cookies can be read by the site (via a custom script). As such it doesn't appear to be a problem with the cookies themselves.

Additionally we're only talking about a very limited amount of text in the cookie so we're not pushing the cookie data limits.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on May 10, 2016 12:39

Hi Leigh,

After advent of HTML5's web storage cookies are not preferred way to store some auxiliary data. Did you try using web storage?

https://blog.newrelic.com/2012/09/18/html5-web-storage-cookies-are-so-1994/

Regarding your condition, there has to be some initial case where in your cookie's value is null and you are setting it. I am not sure what logic are you using to set a cookie.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.