Tracking UTM parameters in Marketo – Part 3

If you are new to UTM tracking or have been trying to figure out what it means, here’s a quick recap of the previous blogs that I’ve written on this topic:

  1. UTM Tracking & Marketo – Part 1
    In the first post, we begin with definitions and establishing and understanding of source, medium, term, content, campaign, the five parts that make up a url parameter for tracking.
  2. UTM Tracking & Marketo – Part Deux
    In the second installment, we lay the groundwork and go into the setup in Marketo as well as a custom script we created to make tracking easier.

I’m happy to finally simplify the process even more and consolidate all of the steps into this simple infographic. The major change is that with the updated script, you will no longer have to add the hidden fields onto your forms. It will add those fields automagically as long as you have the correct fields in your Marketo instance.

Digital Pi's method for tracking UTM parameters in Marketo

Download Digital Pi's UTM tracking script

UTM Tracking & Marketo – Part Deux

In our first post, we discussed the concept of URLs and UTM tracking. Now that those are in place, we will dive into the setup with Marketo. Here are the high-level steps:

  1. Create the UTM fields in order to have a place to store the values
  2. Add the fields on your form pages as hidden fields, add to a landing page
  3. Setup the Marketo programs and/or smart campaigns to process them
  4. Test and check to make sure it’s working

Step 1 – Create UTM fields

If you are setting this up for the first time, or you have inherited a Marketo instance, I recommend checking to make sure these fields are not already in place, or they exist, but are named something else. If you have access, go to Admin > Field Management, and search for any fields containing “utm” or “ppc” to see if they are there. In the screenshot below, you’ll see that all 5 fields have been created and are currently mapped to the SFDC lead and contact records.

*Side note: The mapping is important if you want the values for leads or contacts since SFDC treats them differently. Also, if you are creating them for the first time, make sure to do it in SFDC and wait for the fields to sync to Marketo or you’ll have to get it re-mapped.


Step 2 – Add fields to your forms

Now that you have the fields created, add them to any relevant data forms. There are two main options for this.

  1. If your website uses custom non-Marketo forms, ask your web developer to add the extra fields to the forms and make them hidden. In the field management screen, there’s an “Export Field Names” button which will export all the necessary fields that you can provide to your developer. The file provides a mapping for the UTM values that need to be written to from the website form field to the Marketo field. There might be other options such as native plugins that might already accomplish this.
  2. If you are adding them to a Marketo landing page, drag those new fields onto your forms and make them hidden. In the Autofill property, choose Edit and you’ll see options to chose where the field values will populate from. Choose URL Parameter and type in “none” for the default value or anything that you can filter on later to troubleshoot if it’s not working.



At this point, the landing page is just waiting for a referring visit with UTM values. Consider what happens when someone clicks a link, but does not sign up right away? The values from the URL parameter must be present at the time of submission in order for this to work. So if someone navigates away and the parameters disappear, then the UTM values will not be captured.

To solve for this, we have created a tracking script that will store any UTM parameters it finds into a cookie. Now when a visitor fills out a form that contains the hidden UTM values on a form, the cookie will store the UTM value across the main and subdomains.

*Technical Stuff: You can upload the extracted file into the images directory or on your web server. Before doing so, take note to make one change to the file and re-save it for it to work. Open the file with any text editor and looking for a line that says “” and change it to your domain. Once set, it won’t expire for another 365 days. The script should be place where your Munchkin script is also placed.

It’s a simple script that does the following.

  • If UTM parameters are present, store those into a cookie. This means if it comes from a URL and it’s the first time seeing it, the script creates the cookie.
  • If the visitor comes back by clicking another link with different UTM parameters, it will replace with the new ones and continue to do so.
  • It’s not session specific which means if the visitor closes the browser and comes back at a later date, it will still be in the cookie and keep it for 365 days.



Here’s a link to the tracking script:

So that you can see this process in action, I created a simple form with visible UTM fields on a landing page. When you click on one of the sample links, you should see the UTM values in the UTM fields where they would normally be hidden. If you want to experiment with it, change any of the UTM values after the equal sign and refresh the page. You’ll see the new value populated in the field that was changed.

Long version:

Shortened version:



Step 3 – Setup Marketo processing

This next part is just ordinary Marketo smart campaign building. Setup the trigger filtering on UTM values. Make sure it’s unique enough to process for the individual UTM parameter (campaign, source, medium, etc.).


Step 4 – Test and validate

Create a few URLs to your landing page and use different combinations of UTM parameters and click on your form submission. Look for the test record and in the custom fields look for the values. If they are there, it’s working properly. Keep in mind these values will change each time a new set of UTM values are set. You can run reports on the different campaigns or even down to the add level if programs are setup to track that.


This feature is used frequently, so we hope this article saves a lot of time and frustration. Happy Marketing!!


UTM Tracking & Marketo – Part 1

If you’ve had any conversations around how to track online ads or how to track inbound web links, then you would’ve probably heard of the letters “UTM” or something about “UTM parameters” or “UTM tracking”. The most common scenarios for UTM use are lead source identification and tracking of specific campaign details where multiple visitors land on the same web page, but come from different referrers. It also helps when providing destination urls to third-party agencies, partners, etc. who are sending traffic to your website.

UTM stands for “Urchin Tracking Module” and Urchin was a company that was purchased by Google. This method for tagging links is baked into Google Analytics. To break it down a bit further, a URL parameter is anything added to the end of an URL or typically anything after the question mark. For instance,

These are the 5 main parts that make up the parameter:

  • Campaign Source: (utm_source)
  • Campaign Medium (utm_medium)
  • Campaign Term (utm_term)
  • Campaign Content (utm_content)
  • Campaign Name (utm_campaign)

So why UTM and not anything else? You can use any type of parameter you want, but UTM parameters are well known and widely used. There are some parameters that use their own naming conventions for lead source (=ls or lsd for lead source details, etc.) We recommend using UTM as it is commonly understood and many of the web content management systems have it as a default for tracking links.

As you may have already guessed, this process of correctly inserting UTM parameters into all your links can be tedious and requires consistency. Also, it can become extremely long and unwieldy. Luckily, there are a few ways to make this process easier.

To make the URLs shorter, there are also tools to make this easier. The shortened URLs make it easier to manage and much more simple visually. The key is that when the links are clicked, the full url is revealed so that the rest of the UTM tracking works.

  • – Google provides URL shortener that will turn the long URL above “” to something like this: (much easier to provide).
  • – Bitly is another popular URL shortener and with an account everyone can use it and comes with it’s own level of tracking.

In my next post, we’ll go through how to setup these parameters in Marketo as well as programs to track them.