Welcome to the Instapage Support Center

|

Marketo Munchkin

marketo_logo.png

The main Marketo integration sends the lead collected by your Instapage form to your Marketo list, but it does not associate it with the specific web traffic, and all web data (pages views, dates visited, URL paths, and more) is lost.

In order to associate the lead with the respective web data, Marketo works with its own pixel called Munchkin. There are several ways in which you can implement Munchkin on your pages in order to start collecting the web data corresponding to your leads.

1. Our direct integration

You can use our direct integration to apply this to all of the pages in a subaccount.

Navigate to your Integrations dashboard and select the Marketo Munchkin card to expand it.

munchkin2.png

When you expand the card, you will see this screen where you can place your Asynchronous Munchkin tracking code from the same Marketo account that you already have connected.

munchkin3.png

After adding your code, it will look something like this:

munchkincode_copy.png

By clicking on the Connect button, the Munchkin tracking code will be added to all of your pages on that subaccount.

To disconnect the integration, expand the card and click on the Disconnect button.

munchkin5.png

Then confirm the action:

munchkin6.png

1. Adding Munchkin through Google Tag Manager

If you don't already have GTM connected with Instapage, you can check out our instructional article here.

In order to add the Munchkin script on your pages, navigate to your Google Tag Manager account and add this code, including your Munchkin code in the indicated section:

/*** MUNCHKIN CUSTOM SCRIPT ***/
<script type="text/javascript">

// Paste Asynchronous Munchkin Script (without script tags)
// --- HERE

(function() {
   function getCookie(cname) {
       var name = cname + "=";
       var decodedCookie = decodeURIComponent(document.cookie);
       var ca = decodedCookie.split(';');
       for (var i = 0; i < ca.length; i++) {
           var c = ca[i];
           while (c.charAt(0) === ' ') {
               c = c.substring(1);
           }
           if (c.indexOf(name) === 0) {
               return c.substring(name.length, c.length);
           }
       }
       return "";
   }

   function createInput(cookieValue) {
       var fieldName = "munchkinField";
       var input = document.createElement('input');
       input.name = window.btoa(fieldName);
       input.type = 'hidden';
       input.value = cookieValue;
       return input;
   }

  function appendInput(cookieValue) {
       var forms = document.querySelectorAll('.email-form')
       forms.forEach(function(form){
           var input = createInput(cookieValue);
           var inputExists = form.querySelector('input[name="' + input.name + '"]');
           if (!inputExists) {
               form.appendChild(input);
           }
       })
   }

   var checkCookieInterval = setInterval(function() {
       var cookieName = "_mkto_trk";
       var cookieValue = getCookie(cookieName);
       if (cookieValue) {
           clearInterval(checkCookieInterval);
           appendInput(cookieValue);
       }
   }, 2000);
})();

</script>
/*** END OF SCRIPT ***/

To achieve this, you will need to select Custom HTML within GTM and add the code provided above, with your Munchkin code included in the indicated section, then save. Now, for all of the pages that you have GTM implemented on, your leads will have their web data associated inside Marketo.

munchkin7_copy.png

Marketo Munchkin and GDPR

IMPORTANT: Since Munchkin will place a tracking cookie into the visitor's browser, to make sure your pages are GDPR compliant you will have to implement the Cookie Bar according to this article: Blocking Loading Cookies from Tracking Scripts. If the cookie bar is active Munchkin will not fire unless the visitor accepts the cookies.

If you have implemented Marketo Munchkin through our direct integration, it's enough to simply turn the cookie bar ON. However, if you have implemented it through custom code you will need to wrap the Munchkin code in the GDPR function as explained at the bottom of the article above, then turn the cookie bar ON.

Note that if you have implemented Munchkin through the second option in the article and it has been applied to all of the pages within a subaccount: A visitor that lands on a page without a form and accepts cookies will be tracked as a "Marketo Unknown Lead" until he submits a form on one of your pages that are tracked.


Please note that, currently, Marketo Munchkin has a problem with tracking data across different subdomains of a 2 letter country domain. You can check with Marketo when this bug will be fixed.
It works though if the visits are made on the same subdomain of the 2 letter country domain.

Have more questions? Submit a request
Was this article helpful?
0 out of 0 found this helpful

Need Further Help?

Tell us what you need and we will be happy to assist you.

Our team of expert support staff and our community can answer your questions. Submit a ticket, or reach out on live chat!