cookieDomain setup in Marketing Cloud ID Service via DTM



Could you please help me understand how to properly set up Marketing Cloud ID Service if the site spans multiple domains like shown below

While for the first domain the MCVID setup can be left as it is, for the second one an extra configuration has to be applied:


It is not clear how to dynamically add the cookieDomain setting when the DTM is serving pages on I presume a Data Element should be built and used as shown in screenshot, but I am not sure what values to pass in case if cookieDomain is not required. Could you clarify this?

Accepted Solutions (1)

Accepted Solutions (1)



Thank you Alexis for the support on this topic!

I think it will be better to return a blank value in case of top-level domains where either of last 2 parts of the URL are > two characters.

Answers (2)

Answers (2)




Hi Andrey,

Yes it is correct that it is required to use cookieDomain for multi-part, top-level domains where either of last 2 parts of the URL are > two characters. The "www" prefix is not required when instantiating this variable.

if you do not put cookieDomain = then the cookie will be set on

You DTM configuration seems to be correct.

For the data element I will suggest you to specific custom value if domain like else return default base domain. you can also return "", it will put the cookie to the default base domain, I tested and it works.

Best regards.

Alexis Cazes

Lead Technical Support Engineer



Hi Alexis,

I have setup cookieDomain with DTM. I am finding that the MID isn't always carried to the other domain and is reset with a new one. 

Is this due to load order? IE: Cloud ID Service is done before the data element is available?