Changing AMCV cookie domain



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:

I have found that the cookie is set with the domain Unfortunately this is not the behavior I am looking for. I don't want this cookie to be available on What I want is for the domain to be:

If you have any idea where I could set this in DTM that would really help me out.



Accepted Solutions (1)

Accepted Solutions (1)




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. ""), and will assume the last two dot parts of the domain (location.hostname) is the root domain.  So for example, if your site is "", MCIDS will set the domain as "", and the cookie will be readable on "" or any subdomain of it (e.g. "", "").

For sites that have multi-part TLDs (e.g. "") 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:


..then mcvid cookies will be set with a root domain "".

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)

chrome_2017-12-18_21-54-39 - Copy.png

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:

chrome_2017-12-18_22-28-55 - Copy.png

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=/;[..]".