Page tree
Skip to end of metadata
Go to start of metadata

If your company uses Marketo’s marketing automation platform (MAP), you’ve likely invested considerable time and effort in managing lead data and audience segments. The next step is to integrate Marketo and Interaction Studio so you can leverage data collected in each system and build richer customer and prospect profiles to gain a deeper understanding of each lead. Using data from Marketo helps you to deliver more meaningful visitor experiences using Interaction Studio and passing behavioral and analytics data from Interaction Studio helps you better target your Marketo campaigns.

Interaction Studio Classic Only

Please note, the contents of this article are intended for customers using Interaction Studio (formerly Evergage Classic). Do not adjust your beacon version to downgrade or upgrade.

This Article Explains

This article provides an overview of the typical Marketo lead matching process, discuss how Interaction Studio's "real-time matching" can match additional Marketo leads missed by the typical matching process, and detail how to configure real-time matching.

Sections in this Article

Typical Process for Matching Marketo Leads

When a user on your site provides their email address through a Marketo form, a lead is created in Marketo. The email address associated with the lead can be sent to Interaction Studio so it can be associated with an Interaction Studio user. When the next daily Marketo sync runs, the Interaction Studio user is matched to the corresponding Marketo lead using the email address as the “match field”.

Real-Time Matching Is a Better Approach

But what happens with users who completed Marketo forms before your Interaction Studio integration was set up? In these situations, the email address has been sent to Marketo, creating a Marketo lead, however the email address is no longer present on the page to send to Interaction Studio. Fortunately, when a Marketo form is submitted, Marketo stores a cookie for your site containing a cookie ID that can be used to look up the Marketo lead that was created through a Marketo API call. Interaction Studio offers “real-time matching” which can leverage this Marketo cookie to match the Interaction Studio user to the corresponding Marketo lead the next time this user visits your site. It is called real-time matching, because Interaction Studio makes an API call to Marketo within a few minutes of the event being received. This means that the match can happen right away, without needing a unique identifier between Marketo and Interaction Studio.

How to Configure Real-Time Matching

The process for configuring Marketo real-time matching in Interaction Studio requires only two easy steps:

  1. Add a block of JavaScript code to Site-Wide JavaScript
  2. Enable the Real-time Matching checkbox in the Marketo Third Party Integration Setup
This section will provide detail for completing these steps.

Add JavaScript Code to Site-Wide JavaScript

  1. Log in to Interaction Studio as an Administrator

  2. In Channels & Campaigns, select Web > Site-Wide JavaScript

  3. Copy the block of JavaScript code at the right and paste it at line 1     

  4. Click SAVE

try {
   // Function to read value of a cookie
   function readCookie(name) {
       var cookiename = name + "=";
       var ca = document.cookie.split(';');
       for (var i = 0; i < ca.length; i++) {
           var c = ca[i];
           while (c.charAt(0) == ' ') {
               c = c.substring(1, c.length);
           if (c.indexOf(cookiename) == 0) {
               return c.substring(cookiename.length, c.length);
       return null;
   // Call readCookie function to get value of user's Marketo cookie
   var value = readCookie('_mkto_trk');
   if (value) {
       _aaq.push(["setCustomField", ".tpIds", '{ "Marketo": "' + value + '" }']);
} catch (e) {
   // Ignore.

Enable Real-Time Matching

Once you enable real-time matching, you should begin to see the number of Interaction Studio users matched to Marketo leads start to increase as users who previously completed a Marketo form return to your site.


Real-time matching will use additional Marketo API calls beyond the API calls made by the daily Marketo sync. However, Interaction Studio batches the real-time match calls to minimize the necessary API calls. Confirm that you have sufficient leeway within your Marketo API call limits before enabling real-time matching.

  1. In Channels & Campaigns, select Third Party > Integration Setup > Marketo
  2. On the Setup tab, in the Settings section, select Real time matching
  3. Click SAVE
  4. Real-time matching is now enabled!