Re: Munchkin Code Not Tracking

Anonymous
Not applicable

Munchkin Code Not Tracking

Hello Marketo Community,

I am hoping someone can help with an issue related to our Munchkin Tracking Code. Over the last year we have sporadically been receiving web activity & click link activity for user who visit our website  This issue has caused us to inaccurately utilize some of the features Marketo currently offers because we are unable to consistently receive web & click link activity.

Below you will find what our current implementation looks like along with our attempts at fixing the problem.

Current Munchkin Tracking Code:

<script type="text/javascript">

$.ajax({

  url: '//munchkin.marketo.net/munchkin.js',

  dataType: 'script',

  cache: true,

  success: function() {

Munchkin.init('###-###-###', {asyncOnly: true});

  }

});

</script>

Previous Issue:

XMLHttpRequest.timeout cannot be set for synchronous HTTP(S) requests made from the window context. From: munchkin.js:11

Solution:

set 'asyncOnly: true' flag

References:

We still get what looks like an XHR error when looking at the network tab for "visitWebPage" and also "clickLink".

pastedImage_7.png

Activity like stated before is sporadically not tracked. We connect all our forms via the API. The API originally was on a different top level domain which we changed after reading the following Marketo Document; specifically in relation to the sub-section "Domain"

Due to this documentation we moved our forms API on a subdomain of (see below) to resolve this as a potential cause of this issue; but still receive sporadic web & click link activity.

Below you will also see an instance of a known leads activity log:

pastedImage_14.png

As you can see the first activity recorded for the lead is filling out the form but no web or clicklink activity before or after that.

Any help you may be able to give related to this issue would be greatly appreciated.  If you need more information please feel free to let me know.

- Mihkey

12 REPLIES 12
Kenny_Elkington
Marketo Employee

Re: Munchkin Code Not Tracking

So a few things here.  Those "aborted" requests you're seeing shouldn't affect tracking.  The tracking server will sometimes send reset packets instead of a full response to improve throughput.  Do you have an example page that isn't tracking?  An example form?

Anonymous
Not applicable

Re: Munchkin Code Not Tracking

Kenny Elkington​ Check out HexArmor.com for examples, this issue occurs across the entire site.  Web activity is sporadic at best, and only shows up after a form is filled out if it actually shows up at all.  Any ideas?

Kenny_Elkington
Marketo Employee

Re: Munchkin Code Not Tracking

So the visits look to be registering fine.  I'd bet on this being a lead association problem.  Do you have an example form we could look at?

SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin Code Not Tracking

Nah, I can see the lost Visits and some of the technical reasons.

Anonymous
Not applicable

Re: Munchkin Code Not Tracking

Any of the forms present on our site you can take a look at (contact, trial, quote).

SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin Code Not Tracking

You're posting to your own custom endpoint (this is risky under load) and not including the Munchkin tracking token, unless you happen to be reading from the cookie and adding it to the form data on the server.  If you aren't including the token, it is no surprise at all that your new leads are not getting associated Munchkin sessions.

But that's not the only problem by any means.  Even when you have known leads, you have a single-page website (in uplevel browsers) and you haven't attached Munchkin API calls to all your internal navigation events.  Some of them work automatically because they also have external-like hrefs.  Others do not work because they only have href="#".  You would get different results depending on whether the browser is uplevel or downlevel unless you also hook the use of pushState to ensure that all visitors get a Visit Web Page activity.

SanfordWhiteman
Level 10 - Community Moderator

Re: Munchkin Code Not Tracking

Mihkey, switching to asyncOnly is guaranteed to lose activities, especially Clicked Link.

If you follow and DM me I can supply you with our advanced Munchkin adapter which will clear up the bulk of these issues.

Andy_Varshneya1
Level 9

Re: Munchkin Code Not Tracking

Another note - your Munchkin code is towards the bottom of the body tag. Put it in the header.

Anonymous
Not applicable

Re: Munchkin Code Not Tracking

Hi Andy

Marketo support told me to put munchkin at the end of <body> section.

He taught me this Docs.

Add Munchkin Tracking Code to Your Website - Marketo Docs - Product Docs

5. Place the tracking code on your web pages right before the </body> tag. New leads that visit this page will be assigned to this lead partition.

And he persisted "RIGHT BEFORE the </body> tag".

I want to know why.