Enabling cross-domain tracking with Marketo ensures that tracking information (Marketo cookies) is accurately transferred when users navigate between pages on different domains owned by you. This guide outlines the necessary steps to achieve this. We cover two specific and common use cases of cross-domain user journeys:
- Link Clicks from Domain A to Domain B: For example, you have a landing page on my-lp.com with a call to action (e.g., “Check Pricing”) that takes users to my-main-site.com.
- Marketo Embed Forms with Thank You Pages on a Different Domain: You use Marketo embed forms on domain A (my-lp.com) and your thank you page URLs are on your main website (my-main-site.com).
Another common scenario is when both your Marketo embed form and thank you page are on the same domain (my-lp.com), and the user is then sent an email containing links to your main website (my-main-site.com). In this case, Marketo should natively track and associate the visits to the same user since links within Marketo-delivered emails already contain tracking parameters. You just need to ensure that the Munchkin code is present on both domains. You can easily verify the presence of the Marketo Munchkin tracking code on your webpages.
If there are any other use cases you can think of, please share them in the comments.
Let’s look at both primary cases one at a time. There will be a lot of scripting involved, but as long as you follow the instructions and comments within our scripts, you don’t need much programming background to implement this.
Before we dive into the scripts, let’s understand what cross-domain tracking really means and the tactics we will use to achieve it.
How Does Tracking in Marketo Work?
Web tracking for any analytics tool, including Marketo, relies on cookies. Typically, this involves first-party cookies, so you don’t need to worry about third-party cookie blocking with standard Marketo tracking configurations.
To enable Marketo to track your user’s end-to-end journey, we use a tracking script called Munchkin, which you can find under the Admin section in Marketo. Once the Munchkin script loads in a user’s browser, Marketo sets a cookie named _mkto_trk. This cookie helps in identifying and tracking users across your website. For detailed information about this cookie and other tracking details, you can refer to Marketo’s documentation.
A crucial aspect relevant to this guide is cross-domain tracking. By default, a cookie is associated with a single domain (first-party). If a user visits another domain, Munchkin will set a new cookie value, even if you are using the same tracking code.
Marketo doesn’t inherently recognize that you own multiple domains. Therefore, we need to inform Marketo about these multiple domains and ensure cookie sharing across them. The challenge is to retain the same cookie value when the domain changes, allowing for consistent user tracking.
How to Retain and Pass Cookie Values Across Multiple Domains
To retain and pass cookie values across multiple domains, we will use a method that involves passing the cookie value as a URL parameter during user navigation from one domain to another. Here’s a brief overview of the approach we’ve followed:
- Capture the Cookie Value on Domain A: Extract the value of the _mkto_trk cookie on domain A.
- Pass the Cookie Value via URL Parameter: When the user navigates to domain B, append the cookie value as a URL parameter.
- Set the Cookie on Domain B: On domain B, retrieve the cookie value from the URL and set the _mkto_trk cookie with this value.
This method is akin to how Marketo passes tracking parameters in the URL when someone clicks on a Marketo-delivered email. It’s also similar to how Google Ads uses the “GCLID” parameter and Facebook uses the “fbclid” parameter to maintain tracking consistency.
However, this method requires careful handling of a couple of important considerations:
- Encrypt Cookie Values: To prevent abuse, encrypt cookie values before passing them in the URL.
- Respect Cookie Consents: Ensure that this method is only executed when the user has given consent for cookie tracking.
Let’s look at what tools we need to get this to work
Tools Used for Implementation
To implement cross-domain tracking, we use the following tools. However, alternative tools can be used with similar logic:
- Usercentrics for Consent Management: Alternatives like Cookiebot or other Consent Management Platforms (CMPs) would work similarly.
- Google Tag Manager (GTM) for Firing Munchkin Tracking Scripts: Alternatives include adding scripts directly to the page or using other Tag Management Systems like Tealium, which would follow the same logic.
0 Comments