Skip to main content

HOW TO: Sync Leads + Web Data using Marketo & Unbounce


As many of you may have found out, while Unbounce can send lead data to Marketo, it cannot associate web data with the Marketo Munchkin Pixel. Having recently started a new role which used web-data in lead scoring and sales, I needed to find a solution to bridge this gap in order to continue using Unbounce.


Luckily, with a lot of research and testing, our team has come up with a solution that has been working consistently for the past 4 months. My goal in posting this here is to both assist users in their setup, and give the Unbounce team some insights of how this process can possibly be improved.


THE PROBLEM


Marketo not only collects leads, it also associates web data for each user: including pages views, dates visited, URL paths, and more. To do this, Marketo works with it’s own pixel called ‘Munchkin’ to pair this data. Typically, all forms on a website need to integrate correctly in order to properly link and associate the pixel data with form data.


Unbounce, since it’s a third-party, has it’s own forms and instead sends the lead via API to Marketo. In doing this however, the lead is not associated with the specific web traffic, and all web data is lost.


WHAT DOESN’T WORK


Simply adding the Munchkin pixel to Unbounce will not work. Munchkin will gain insights into all web traffic, but it has no way of associating a specific user with a specific lead from Unbounce. The only exception to this is if the user already exited within Marketo. Additionally, adding a hidden field to Unbounce will not work, as Marketo cannot generate a new Munchkin ID on an Unbounce page–nor will the pixel create this for you. It requires PHP.


THE SOLUTION


To correctly associate the lead to Marketo an API “Associate_Lead” call needs to happen to link these pieces of data. Unfortunately, this code runs in PHP which is server-side and cannot be placed within Unbounce. There is still a workaround however:


STEP 1: Link Your Unbounce Landing Page to Marketo to pass lead data


STEP 2: Place your Munchkin Pixel on the specific landing page or domain using Unbounce.


STEP 3: Create your form within Unbounce and have it forward to a /thank-you/ URL which you control. To do this correctly, you will need to ensure the form is set to “post data to URL” within the forwarding options.


STEP 4: Create the associate_lead call on your /thank-you/ page in PHP. (You may need a developer to help you with this, as I did). I have placed this code below:


Things to keep in mind:




  • Field names need to exactly match the ID files in Unbounce




  • Not all fields need to be present in the API call, just enough to associate the lead Unbounce gave to Marketo with the unique pixel (Try email, first name, last name)




  • Within Marketo, you will need to setup an API for Unbounce and put the APISecret into the PHP. I have marked this in the code below with square brackets for you.







jQuery(window).on('load', function() {
Munchkin.munchkinFunction(
'associateLead',
{
FirstName: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUESTr"firstName"]) . '")'?>,
LastName: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUESTr"lastName"]) . '")'?>,
Email: <?php echo 'decodeURIComponent("'. rawurlencode($_REQUESTr"email"]) . '")'?>
},
'<?php echo hash('sha1', '*pYour Marketo Secret]*' . $email); ?>'
);
});
</script>

After this setup is complete, run some extensive tests to ensure it’s working correctly. You can check within Marketo if you can see the web traffic associate with the new leads.


From our testing these past few months, this system works–it’s just a bit more setup as you always need a 'thank-you/ page after every form submit.


Currently there are no landing page solutions on the market which can correctly associate Marketo leads with web-data. Now Unbounce can 🙂

Colin, once again your brilliance amazes me!! This is spectacular!


Hey Colin, great info. Looking to implement this solution. Is this solution still working for you? @colinsa


Hi Erik!


We’ve been using this solution successfully for about 11 months now. It’s handled tens of thousands of leads and is still working perfectly!


@colinsa We are trying to get this code to work but aren’t having any success. The original function has this portion…



Munchkin will pass the anonymous vistor’s tracking ID when you call the function:


input type=“hidden” name=“munchkinId” class=“mktoField mktoFieldDescriptor” value=“XXX-XXX-XXX”



Did you not include this? Also does it matter if we use email vs _REQUESTa“email”] in


‘<?php echo hash('sha1', '*lYour Marketo Secret]*' . $email); ?>’


Reply