Effect and usage of the domainlevel munchkin Initialization Parameter | Community
Skip to main content
Grégoire_Miche2
Level 10
January 31, 2016
Solved

Effect and usage of the domainlevel munchkin Initialization Parameter

  • January 31, 2016
  • 2 replies
  • 8457 views

I was told a while ago by support that when using the munchkin tracking on a domain which top level domain had only 2 letters, we had to set the domainlevel munchkin init parameter to 2.

Reading the doc, it seems that this parameter has a totally different effect :

Sets the number of pieces from the page’s domain to use when setting the domain parameter of the cookie: domainLevel: 2 will set the domain parameter to “.example.com,” while domainLevel: 3 will set the cookie to “.www.example.com.”

Based on this doc, it seems that the use of it would be to handle situations such as mydomain.co.uk (common UK URL) or mydomain.com.br (Common Brazilian one) (in which cases it should be set to 3)

Question 1: Who is right, the support or the doc ?

Question 2: I also gather from the fact that the parameter is not usually needed when on a mydomain.com domain, the default value is 2. Is this correct ?

Question 3: do I have to change it on a Marketo LP that is hosted in a mydomain.com.br ?

-Greg

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Question 1: Who is right, the support or the doc ?

The doc is more correct, but the overall picture is more complex (and has major bugs).

When computed dynamically, the domainLevel does take into account the number of letters in the TLD.  The effort is to intuit the registered domain (the highest level at which the browser will let you set cookies) but it clearly does not always work.

When you set it statically, the domainLevel doesn't have any direct relationship to the number of letters in any component.  You should set it to the true level at which you want to set the cookie, even if the domain is my www.example.somereallylongtld.

Question 2: [O]n a mydomain.com domain, the default value is 2. Is this correct ?

When specifically on an example.com domain, yes.

Question 3: [D]o I have to change it on a Marketo LP that is hosted in a mydomain.com.br ?

No, because it will dynamically set to 3 but I would set it manually anyway.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
January 31, 2016

Question 1: Who is right, the support or the doc ?

The doc is more correct, but the overall picture is more complex (and has major bugs).

When computed dynamically, the domainLevel does take into account the number of letters in the TLD.  The effort is to intuit the registered domain (the highest level at which the browser will let you set cookies) but it clearly does not always work.

When you set it statically, the domainLevel doesn't have any direct relationship to the number of letters in any component.  You should set it to the true level at which you want to set the cookie, even if the domain is my www.example.somereallylongtld.

Question 2: [O]n a mydomain.com domain, the default value is 2. Is this correct ?

When specifically on an example.com domain, yes.

Question 3: [D]o I have to change it on a Marketo LP that is hosted in a mydomain.com.br ?

No, because it will dynamically set to 3 but I would set it manually anyway.

Grégoire_Miche2
Level 10
January 31, 2016

Hi Sanford,

Thx, that is much clearer.

So, for anyone else involved in an International roll-out and reading this post (Please Sanford correct me if I am wrong) :

  • on mydomain.com and any domain with a 3 letters TLD, ..., you should leave the default value and use the munchkin code as provided by Marketo, unless you observe tracking failure (look at Marketo _mkto_trk cookie and see at which domain it is set)
  • on mydomain.fr, mydomain.de, and any domain with a 2 letters TLD, you should force {domainlevel:2} on munchkin inserted on your web site and ALSO REPLACE DEFAULT Marketo MUNCHKIN ON LP templates
  • on mydomain.co.uk, mydomain.com.br, you should force {domainlevel:3} parameter and also add manually the changed munchkin code to your Marketo landing page templates.

-Greg

EDIT : corrections made following Sanford's comments below.

SanfordWhiteman
Level 10
January 31, 2016

Ah, not quite! Notice I bolded ".com" in my response because that's what you were spec'ly asking about. The same does not apply to other TLDs. Even when the registered domain is, factually, the second-level domain, if the TLD has 2 letters Munchkin makes erroneous assumptions about the registered domain.

So actually .fr is treated like .com.br which obviously is incorrect. Munchkin default works for the latter, as I said, but not the former.

I'll write more later as I had to step out for a bit and mobile is not the way to post...

SanfordWhiteman
Level 10
September 30, 2016

@Grégoire Michel I finally pubbed this stuff on my blog: http://blog.teknkl.com/munchkin-2-letter-tlds-broken/

Level 2
November 21, 2017

@Sanford Whiteman​

Thanks so much for the post on dealing with 2 letter TLDs. [24]7 ha moved from a domain of 247-inc.com to 247.ai. I'm trying to cleanup all the issues.

I've implemented your code on this page: Testing new template 

I added console.info() statements so I can see it is indeed returning 2 level and domain as .247.ai

However, the second part doesn't seem to be working _mkto_trk is still associating to info.247.ai. The only difference in the code is that we never switched to using munckin-beta. Do we have to be using munchkin-beta? If so, what other implications do we need to deal with?

Thanks so much!

Sheila

Grégoire_Miche2
Level 10
November 21, 2017

Hi Sheila,

No, you do not have to activate Muchkin Beta.

The code on your page works fine and the cookie is posted to the domain, not the sub domain.

If you have old cookies in your browser, from previous navigations, clean before testing.

But you munchkin call are at the bottom of the body and you are using a synchronous version.

You should rather use an unsynchronous version of the code and post it before the </head> tag.

-Greg