SOLVED

Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

Go to solution
svansoest
Level 1

Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

Hi there, 

 

I'm seeking assistance with a Marketo Munchkin tracking implementation issue. We're implementing Marketo tracking in our new headless CMS environment:

 

Environment:

  • Headless CMS built in Optimizely
  • Next.js framework
  • Marketo Munchkin implementation (via GTM and hardcoded - both tested)

 

Issue: We're experiencing problems with the _mkto_trk cookie. Every page reload or form submit is being tracked as a new visitor due to an unique token ID. Resulting in an incorrectly tracking for returning visitors and form submitters by a refresh of the _mkto_trk cookie. As the website is Headless we're aware that every pageview needs to be tracked separately via a HistoryChange event, so navigation through the website works as intended.

 

Could you please advise on the correct implementation approach for our headless architecture or suggest potential solutions to maintain consistent visitor tracking?

 

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

You can solve it right now by setting domainLevel:

 

Munchkin.init("AAA-BBB-CCC", { domainLevel: 3 } );

Set it to 2 or 3 based on the environment.

 

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

What is the actual domain you're using? This sounds like the behavior if you try to set the cookie at a public domain suffix. For example, if you're building on Netlify, you cannot set a cookie at netlify.app because even though that's technically a private domain, it's on the PSL and is treated as public.
svansoest
Level 1

Re: Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

@SanfordWhiteman 

Ah yeah, that's indeed my concern as well. We're running on a sub-domain of vercel.com/ where the test and staging environments are hosted at this moment. Do you think when we move to our own domain this issue can be solved?

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Munchkin Tracking Issue - New Token ID Generated on Page Reload in Headless CMS

You can solve it right now by setting domainLevel:

 

Munchkin.init("AAA-BBB-CCC", { domainLevel: 3 } );

Set it to 2 or 3 based on the environment.