Secret Options To Speed Up Marketo Munchkin Code

Marketo munchkin.js is the tracking code that is added to all Marketo pages that allows you to track known and unknown visitors to your website. I was getting some reports of slowness when users were clicking on links of our site and it seemed to be caused by the munchkin.js link tracking code.

In our case, we really only cared about the page that the user visited, not really the links that were clicked on, so I was looking for a way to disable the link click tracking in the munchkin code. Any searches for customizing the munchkin code seemed to land me on this Lead Tracking page from Marketo. It didn't have a lot of details about disabling things, but the one part that was helpful toward the bottom was about the click link delay. 

When a link is clicked, or a Web page visit has been completed, Munchkin delays before completing the action (sending through the link click or posting a form). The default delay is 200 milliseconds.

It turns out the default delay is actually 350ms when I dug through the munchkin.js code. So in your tracking code, when you call Munchkin.init(), you can send it an additional parameter of {clickTime:100} which will change the click time to be 100ms instead of the default. It looks like this:

Munchkin.init("###-###-###",{ clickTime : 100 });

While digging through the code, I actually found a few other parameters that you can set to customize the way your munchkin tracking behaves.

{
  customName: null,
  notifyPrefix: null,
  wsInfo: null,
  altIds: [],
  visitorToken: null,
  cookieLifeDays: 730,
  clickTime: 350,
  cookieAnon: !0,
  mkt_tok: null,
  domainLevel: null,
  replayDetectLimit: 5E3,
  httpsOnly: !1,
  asyncOnly: !1
}

What I found was that setting asyncOnly:false and clickTime:0 effectively disables the delay caused by clicking links (if you don't care about them). So my code looks like:

Munchkin.init("###-###-###", { clickTime : 0, asyncOnly : true });

I didn't see this published anywhere so hopefully this helps someone.

Welcome to the New SavageAutomation.com

Well it's time to kick things into high gear. I ditched my old WordPress site and now am using SquareSpace.  So I built out a new site, grabbed some trending templates, some nice photos from Dreamstime, and here we are.

So why Savage Automation? Well most of the time I will be working on my first love, FreeAdWordsScripts.com, but when I have an idea for an automation that doesn't really have anything to do with AdWords scripts, I will post it here.

Also, I am opening a script store where you can find some more advanced versions of some of the scripts I build and post for free. Mainly, these scripts are built for agencies and larger accounts. I am hoping that the free version will have more than enough functionality for 99% of the people out there. The scripts for sale here will be geared towards agencies managing lots of accounts.

That's it for now.

Thanks,
Russ