Info on the Marketo cookie is here.
I’ve found two things in the snowplow docs:
- Extracting GA cookie id
What is the difference between these two approaches?
Naive JS question: do I have to make sure the Marketo JS script is above the Snowplow JS script to ensure that the Marketo cookie is defined before I try to extract the identifier?
Which way to go depends on the complexity of the cookie’s value.
Generally, a cookie is saved in a name-value pair like
cookie_name=value. Therefore if the cookie contains just the user id, for example
userId=abc123 then you could retrieve that value and set it (implicitly) with a function call like:
However, quite often the cookie’s value is more complected as is the case with Google Analytics. First, you would have to extract the ID and then manually (explicitly) set it with
Judging by the look of the Marketo cookie you would have to come up with a function extracting the ID first as the cookie appears to be made up of a couple of values (where ID is just one of them) and follows the pattern