Marketo's custom JavaScript tracking code, called Munchkin, tracks all individuals who visit your website so you can react to their visits with automated marketing campaigns. Even anonymous visitors are tracked along with their IP addresses and other information. Without this tracking code, you will not be able to track visits or other activity on your website!

Please ensure that you have access to an experienced JavaScript developer. Marketo Technical Support is not set up to assist with troubleshooting custom JavaScript.


Add Tracking Code to Your Website

Adobe Experience Cloud customers can also use Marketo's integration in Adobe Launch to include Munchkin script on their web pages. Get the app here.

Go to Admin and click Munchkin in the tree on the left.

Select Asynchronous for Tracking Code Type.


In almost all cases, you should use the asynchronous code. Learn more.


Click and copy the Javascript tracking code to put on your website.


Don’t use the code shown in this screenshot - you must use the unique code that appears in your account!



Put tracking code on the web pages you want to track. This may be every page for smaller sites, or only key pages on sites that have many dynamically generated Web pages, user forums, and so on.

For best results, use the asynchronous Munchkin code and place it inside the <head> elements of your pages. If you are using the simple code (not recommended), this is right before the </body> tag.

For sites that see a high volume of traffic (i.e., hundreds of thousands of visits per month), we recommend you opt not to track anonymous people. Learn more.

Add Tracking Code When Using Multiple Workspaces

If you're using Workspaces in your Marketo account, you probably also have separate web presences that correspond to your workspaces. In that case, you can use the Munchkin tracking Javascript to assign your anonymous people to the correct workspace and partition.

Go to Admin and click Munchkin in the tree on the left.

 Select the appropriate workspace for the web pages you wish to track.


If you don't use the special workspace Munchkin code, the people will be assigned to the default partition that was created when your account was set up. It's named "Default" initially, but you might have changed that in your own Marketo account.


Select Asynchronous for Tracking Code Type.

 Click and copy the JavaScript tracking code to put on your website.


Don’t use the code shown in this screenshot - you must use the unique code that appears in your account!

 Place the tracking code on your web pages in the <head> element. New people that visit this page will be assigned to this partition.



You can only use one Munchkin tracking script for a single partition and workspace on a page. Do not include tracking scripts for multiple partitions/workspaces on your website.

Landing pages created in Marketo automatically contain tracking code, so you don’t need to put this code on them.


Types of Munchkin Tracking Codes

There are 3 types of Munchkin tracking codes you can choose from. Each impact the webpage load times differently.

  1. Simple: has the fewest lines of code, but does not optimize for webpage loading time. This code loads the jQuery library each time a webpage is loaded.
  2. Asynchronous: reduces webpage loading time. This code checks if the jQuery library already exists, loads it if it's missing, and uses it for executing tracking code once the rest of the webpage has loaded.
  3. Asynchronous jQuery: reduces webpage loading time and also improves system performance. This code assumes that you already have jQuery, and does not check to load it.

Test if Your Munchkin Code is Working

To check that your Munchkin code is working after you've added it:
Visit your web page.
Go to Analytics.

Click Web Page Activity.

Click the Setup tab, double-click Activity Source, and change it to Anonymous Visitors (including ISPs).

Click the Report tab. If you don't see any data, wait a few minutes, then click the refresh icon at the bottom.