Marketo UTM Tracking: How to Fix Broken Attribution
If your RevOps person is squinting at records to find campaign origins, your Marketo UTM tracking is likely broken. Here is the operator-grade setup guide for capturing UTMs on forms and closing the loop from click to closed-won.
The Friday Night Squint
A lead fills out a form on your site. It lands in Marketo. And then someone in RevOps spends Friday night squinting at the record, trying to figure out which campaign actually sent them. Marketo UTM tracking fixes that by stamping every inbound link with parameters, source, medium, and campaign, and then carrying those tags into the form as hidden fields, so the "where did this lead come from" question answers itself.
That's the whole game. Tag the link, capture the tag on the form, map it to a Marketo field. Do it consistently and your attribution is trustworthy. Do it sloppily and your best channel disappears into the (Other) bucket where bad data goes to die.
I've been doing GTM tagging and attribution work for seven years, on pipelines that have moved hundreds of millions in spend. The pattern below is the one I'd hand a client. If you'd rather hand the whole thing off, our marketing-tech integrations team wires up UTM capture and closed-loop attribution end to end.
What is Marketo UTM tracking?
Marketo UTM tracking is the practice of adding UTM parameters to the URLs in your campaigns, then capturing those values on your Marketo forms so each lead carries its own origin story into the CRM. The link tells you where the click came from. The form captures it. The record remembers it.
UTMs themselves aren't a Marketo feature; they're a Google Analytics convention that everything else reads. Marketo's part is grabbing those values off the URL and stashing them on the lead record so they survive past the click.
The five UTM parameters, and what they are actually for
Every tagged URL is built from the same five elements. Use them for what they're meant for, not whatever's convenient at 11pm.
- utm_source, where the traffic came from:
google,linkedin,newsletter. - utm_medium, how it got there:
cpc,email,social. This is the one people break the most. - utm_campaign, the specific push:
spring-launch,q3-webinar. - utm_term, paid keywords. Mostly auto-tagged by ad platforms; you rarely set it by hand.
- utm_content, the variant: which ad, which button, which email link.
Add those to a link, and analytics can tell you how many people clicked, where they came from, and what they did next. Capture them on the form, and Marketo can tell you which of those clicks turned into pipeline. For a deeper look at how the pieces fit, our guide to UTM formats and how they impact your marketing pipeline goes one layer down.
How to set up Marketo UTM tracking
Here's the sequence. Nothing exotic, but the order matters and the field mapping is where people quietly break their data.
- Create the Marketo custom fields. Before you capture anything, you need somewhere to put it. Make custom fields for each UTM value (the code below uses
utm_source__c,utm_medium__c, and so on). No field, no capture. - Build clean tagged URLs. Use the five parameters above. Lowercase, consistent, no spaces. This is the step that decides whether your reporting is usable later.
- Add UTMs to your campaign links. Every inbound link, ads, email, social, gets tagged. Internal links do not; tagging your own internal links overwrites the original source and corrupts attribution.
- Capture the UTMs on the form. Pull the values off the URL and write them into the form's hidden fields. The code for that is below.
- Track and report. With the values landing on the lead record, you can tie a closed deal back to the campaign that started it. For more advanced first-party tracking, our Analytics & Attribution module connects ad spend directly to revenue without handing your data to third parties.
To capture UTMs on the form, you can use code like this:
MktoForms2.whenReady(function (form) {
let formId = form.getId();
let utm = getUTM();
let temp = navigator.userAgent;
form.addHiddenFields({
utm_source__c: (utm["utm_source"] == undefined) ? '' : utm["utm_source"],
utm_medium__c: (utm["utm_medium"] == undefined) ? '' : utm["utm_medium"],
utm_campaign__c: (utm["utm_campaign"] == undefined) ? '' : utm["utm_campaign"],
utm_content__c: (utm["utm_content"] == undefined) ? '' : utm["utm_content"],
utm_term__c: (utm["utm_term"] == undefined) ? '' : utm["utm_term"],
GCLID__c: (utm["gclid"] == undefined) ? '' : utm["gclid"],
FBCLID__c: (utm["fbclid"] == undefined) ? '' : utm["fbclid"],
conversion_source__c : "",
browser: temp,
});
});
A couple of things worth noting in that snippet. It also grabs gclid and fbclid, the Google and Facebook click IDs, which are what let you reconcile back to the ad platforms even when a UTM is missing. And every value falls back to an empty string if the parameter isn't present, so a clean direct visit doesn't write undefined into your CRM. The same getUTM() pattern works in Webflow too, here's the worked example of capturing UTMs in a Webflow form.
Troubleshooting: Why is my Marketo landing page not tracking?
If you're looking at your CRM and seeing empty fields or undefined values, something in the chain is broken. Check this checklist to see where the leak is:
- The URL has no parameters. Your campaign link actually contains the
utm_source=...tags. If they aren't in the browser bar, they aren't being captured. - The form fields are missing or misnamed. You need custom fields in Marketo for each UTM value (like
utm_source__c). If the field doesn't exist, the code has nothing to write to. - Internal links are overwriting your source. If you used UTMs on a link from your homepage to your landing page, you just wiped out the original ad click. Only tag inbound links.
- The JavaScript is failing. Check your console for errors. If the
getUTM()function isn't loading or has a typo, the hidden fields will stay empty.
Best practices for Marketo UTM tracking
This is where most setups quietly fall apart. Mapping is the part nobody respects until it bites them, one wrong value and the whole attribution chain breaks downstream.
- Pick a naming convention and never deviate.
cpcandCPCandpaid-cpcare three different mediums to a machine. Off-spec mediums vanish into the(Other)bucket and never come back. Consistency beats cleverness every single time. - Lowercase everything. UTMs are case-sensitive.
Googleandgooglewill split one source into two rows in your reports. Pick lowercase and enforce it. - Only tag inbound links. Tagging links between your own pages rewrites the original source on every internal click. It's one of the most common self-inflicted attribution wounds I see.
- Don't over-tag. Use the parameters that map to a real decision you'll make. Five fields you actually report on beat nine you ignore.
FAQ
Does Marketo capture UTMs automatically? No, Marketo doesn't know about your URL parameters out of the box. You have to create custom fields and use a script or a tool to pull those values from the URL into the form.
Why is my Marketo landing page not tracking? It usually comes down to missing custom fields in Marketo, broken JavaScript on the form, or using internal UTM links that overwrite your original source. Check your URL parameters first to ensure they are actually present in the browser.
Should I tag links between my own pages with UTMs? You should never do this. Internal tagging overwrites the visitor's original source, which breaks your ability to see how they actually arrived on your site.
What is the difference between a UTM and a GCLID? UTMs are manual tags you create for any platform, while a GCLID (Google Click ID) is an automated string generated by Google Ads. Capturing both ensures you have attribution even if one method fails.
Want this wired for you?
If your setup is leaking attribution somewhere between the click and the CRM, it's time to fix the plumbing. We've already built most of the logic required to close this loop. If you want a reliable signal path from click to closed-won, talk to our team or browse our module catalog to see how we automate the heavy lifting.