Read time :
Salesforce UTM Tracking : How to do it in 2027
Track UTM parameters in Salesforce Web-to-Lead forms. Capture every touchpoint and use Heeet for full multi-touch attribution to revenue
Salesforce UTM tracking means getting utm_source, utm_medium and utm_campaign from the ad click onto the Lead record, where your pipeline and revenue reports can use them. If you run paid campaigns or SEO content into Salesforce, that’s how you see what’s driving leads.
At Heeet, we’ve seen too many marketing teams struggle with a gap between Google Analytics and Salesforce. UTM data gets lost between the click and the CRM. Here’s the Web-to-Lead setup that closes the gap, plus the point where it stops being enough.
To keep your tracking consistent across every campaign link, use our free UTM builder to generate standardized UTMs in seconds
Why Track UTM Parameters in Salesforce?
UTM parameters (like utm_source, utm_medium, and utm_campaign) are the foundation of campaign attribution. But if they don’t make it into Salesforce, your lead source reporting is incomplete or worse, wrong.
Capturing this data allows you to:
- See exactly which campaigns generate real pipeline
- Prove the ROI of paid, organic, and partner campaigns
- Optimize your spend by doubling down on top-performing channels
How to Capture UTM Parameters in Salesforce Web-to-Lead Forms
Salesforce Web-to-Lead doesn’t capture UTM data by default. But with a few smart tweaks, you can track every touchpoint.
Step 1: Add Hidden Fields to Your Forms
Add the following hidden fields to your Web-to-Lead form:
utm_sourceutm_mediumutm_campaignutm_termutm_content- and optionally
gclid,gbraid,wbraidandfbclid
Create each one as a custom field on the Lead object first, then generate the form in Setup > Web-to-Lead. Salesforce names each custom field’s input after its field ID, a string starting with 00N. That ID is what tells Salesforce where to save the value. A hidden input named utm_source gets ignored, so keep the 00N names and give each input an id that matches the parameter:
<input type="hidden" name="00N5g00000AbCdE" id="utm_source">
Step 2: Use Cookies to Store UTM Data
A visitor might read three pages before the form, and the UTMs vanish from the URL after the first click. Store them in a cookie on arrival, then copy them into the hidden fields when the form loads. Run this on every page:
const params = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
const url = new URLSearchParams(location.search);
params.forEach(param => {
const value = url.get(param);
const alreadySet = document.cookie.split('; ').some(c => c.startsWith(param + '='));
if (value && !alreadySet) {
document.cookie = `${param}=${encodeURIComponent(value)}; path=/; max-age=${60 * 60 * 24 * 90}; SameSite=Lax`;
}
});
params.forEach(param => {
const match = document.cookie.match(new RegExp('(?:^|; )' + param + '=([^;]*)'));
const field = document.getElementById(param);
if (match && field) field.value = decodeURIComponent(match[1]);
});The cookie is written once, on the first tagged visit, and lasts 90 days. That keeps the original source on the Lead even if the visitor comes back later through a different campaign. One limit: Safari deletes cookies set by JavaScript after seven days, so a Safari visitor who takes longer than a week to convert arrives without UTMs.
Step 3: Map the Fields in Salesforce
Because each input carries its custom field’s 00N ID, there’s nothing else to map. Salesforce writes the value straight to that field on the new Lead. Before you go live, open a tagged URL, submit a test form and check the Lead record. Web-to-Lead also caps submissions at 500 per 24 hours, which matters once spam bots find the form.
For revenue attribution beyond the form fill, pair UTM capture with native Salesforce tracking.
Going Beyond: Multi-Touch Attribution in Salesforce
The Web-to-Lead setup above captures first-touch attribution: one source per Lead. What about every touch after it?
Heeet helps you go further by:
- Tracking all touches, from first visit to closed-won
- Capturing offline touches like sales calls and emails
- Connecting UTM data to Campaigns, Opportunities, and Revenue
- Visualizing the full customer journey inside Salesforce
Instead of messy spreadsheets and disconnected tools, Heeet brings all your attribution data into one place right inside your CRM. Our guide to multi-touch attribution in Salesforce shows how that data gets turned into pipeline credit.
Salesforce UTM tracking FAQ
Does Salesforce capture UTM parameters automatically?
No. Web-to-Lead only saves the fields included in the form. Each UTM needs a custom Lead field and a hidden input that uses that field’s 00N ID as its name.
Why are the UTM fields empty on my new Leads?
Usually the hidden inputs are named after the parameter (utm_source) instead of the custom field’s 00N ID. The other common cause is a visitor who browsed to another page before the form, which the cookie step above fixes.
What’s the difference between UTM tracking and multi-touch attribution?
UTM fields on the Lead record one touch. Multi-touch attribution records every touch from first visit to closed-won and splits the credit across them.
Start Tracking What Matters
Don’t let attribution gaps slow down your marketing.
- ✅ Set up UTM tracking on your Web-to-Lead forms
- ✅ Store and sync UTM data with Salesforce
- ✅ Use Heeet to see the full customer journey from click to revenue
Ready to connect every touchpoint to revenue? Book a Demo
Other articles
How to Set Up Offline Conversion Tracking with Google Ads: A Complete 2027 Guide for B2B Marketers
Connect Google Ads to Salesforce with offline conversion tracking. Capture GCLIDs, sync CRM data, and attribute real revenue to your campaigns.
Ready to track prospects from lead to close with Heeet?
Heeet gives marketers and sales professionals at IT & Security firms turn geuss work intro informed decisions that drive revenue while meeting the same secruity technical standards you provide your clients.




