I want to be able to set the domain of my AMCV cookie to the window.location.pathname or equivalent. For example, I have a website with this url pattern:
my.coolWebsite.com
I have found that the cookie is set with the domain .coolWebsite.com. Unfortunately this is not the behavior I am looking for. I don't want this cookie to be available on your.coolWebsite.com. What I want is for the domain to be: my.coolWebsite.com.
If you have any idea where I could set this in DTM that would really help me out.
Thanks
E
Solved! Go to Solution.
WARNING: The below information details a Marketing Cloud ID Service configuration property officially listed in the documentation, but the documentation explicitly states its use case, and the below information does not follow that use case. This is a warning to you that if you implement the below, Adobe may not support your implementation. Even if you reverse-engineer the code behind something and it looks safe enough to use today, there's no guarantee it won't change tomorrow! So, use at your own risk!
Having said that..
Setting the root cookie domain
By default, Marketing Cloud ID Service assumes your domain has one TLD level (e.g. "mysite.com"), and will assume the last two dot parts of the domain (location.hostname) is the root domain. So for example, if your site is "www.mysite.com", MCIDS will set the domain as ".mysite.com", and the cookie will be readable on "mysite.com" or any subdomain of it (e.g. "www.mysite.com", "foo.mysite.com").
For sites that have multi-part TLDs (e.g. "mysite.co.uk") MCIDS has a config property named cookieDomain you can use to specify the root level domain the mcvid cookies are set on.
For example, if you have the following:
cookieDomain:"mysite.co.uk"
..then mcvid cookies will be set with a root domain ".mysite.co.uk".
As mentioned, officially, this setting is meant for multi-part TLDs. But looking at the MCIDS library code, when writing the cookie, it will set the domain= portion of the cookie with what you specify in cookieDomain. So, this means you are able to directly set the cookie domain to whatever you want (according to the rules/restrictions of setting cookie domains in general, anyways).
Within DTM, you can set this by navigating to the DTM Property, then
Overview > Marketing Cloud ID Service > Config (gear icon)
Then, under General > Settings
For Name, add "cookieDomain" (no quotes)
For Value, add the domain you want to be the root domain for the cookie:
Setting the cookie path
You mentioned location.pathname (which represents e.g. "/foo/bar.html" part of your URL) in your question, but your example showed changing the domain. My assumption is this was a typo and you really meant location.hostname. But for sake of completion, currently there is nothing in the documentation shown for specifying the cookie path for the mcvid cookies. Also, I took a look at the MCIDS code itself and looks like it's just hardcoded to root "[..]path=/;[..]".
WARNING: The below information details a Marketing Cloud ID Service configuration property officially listed in the documentation, but the documentation explicitly states its use case, and the below information does not follow that use case. This is a warning to you that if you implement the below, Adobe may not support your implementation. Even if you reverse-engineer the code behind something and it looks safe enough to use today, there's no guarantee it won't change tomorrow! So, use at your own risk!
Having said that..
Setting the root cookie domain
By default, Marketing Cloud ID Service assumes your domain has one TLD level (e.g. "mysite.com"), and will assume the last two dot parts of the domain (location.hostname) is the root domain. So for example, if your site is "www.mysite.com", MCIDS will set the domain as ".mysite.com", and the cookie will be readable on "mysite.com" or any subdomain of it (e.g. "www.mysite.com", "foo.mysite.com").
For sites that have multi-part TLDs (e.g. "mysite.co.uk") MCIDS has a config property named cookieDomain you can use to specify the root level domain the mcvid cookies are set on.
For example, if you have the following:
cookieDomain:"mysite.co.uk"
..then mcvid cookies will be set with a root domain ".mysite.co.uk".
As mentioned, officially, this setting is meant for multi-part TLDs. But looking at the MCIDS library code, when writing the cookie, it will set the domain= portion of the cookie with what you specify in cookieDomain. So, this means you are able to directly set the cookie domain to whatever you want (according to the rules/restrictions of setting cookie domains in general, anyways).
Within DTM, you can set this by navigating to the DTM Property, then
Overview > Marketing Cloud ID Service > Config (gear icon)
Then, under General > Settings
For Name, add "cookieDomain" (no quotes)
For Value, add the domain you want to be the root domain for the cookie:
Setting the cookie path
You mentioned location.pathname (which represents e.g. "/foo/bar.html" part of your URL) in your question, but your example showed changing the domain. My assumption is this was a typo and you really meant location.hostname. But for sake of completion, currently there is nothing in the documentation shown for specifying the cookie path for the mcvid cookies. Also, I took a look at the MCIDS code itself and looks like it's just hardcoded to root "[..]path=/;[..]".
Thank you!
Views
Replies
Total Likes
Views
Likes
Replies