The Ultimate Guide to Salesforce Marketing Attribution in 2025

July 9, 2025
If you're running paid campaigns or SEO content and using Salesforce, tracking UTM parameters is essential to understand what’s driving leads, pipeline, and revenue.
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. In this article, we’ll show you how to fix that so you can track every touchpoint and finally attribute revenue to the right source.
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:
Salesforce Web-to-Lead doesn’t capture UTM data by default. But with a few smart tweaks, you can track every touchpoint.
Add the following hidden fields to your Web-to-Lead form:
utm_source
utm_medium
utm_campaign
utm_term
utm_content
gclid
, fbclid
, etc.These fields should be created as custom fields on the Lead object in Salesforce.
Since a user might visit multiple pages before converting, you’ll want to store UTM data in cookies and repopulate the hidden fields automatically when the user submits the form.
Example JavaScript (simplified):
function getParam(name) {
const match = location.search.match(new RegExp(name + '=([^&]+)'));
return match ? decodeURIComponent(match[1]) : null;
}
['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'].forEach(param => {
const value = getParam(param);
if (value) {
document.cookie = `${param}=${value}; path=/`;
}
});
Then, when the form loads:
['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'].forEach(param => {
const cookieMatch = document.cookie.match(new RegExp(`${param}=([^;]+)`));
if (cookieMatch && document.querySelector(`[name=${param}]`)) {
document.querySelector(`[name=${param}]`).value = decodeURIComponent(cookieMatch[1]);
}
});
Make sure your hidden form fields are correctly mapped to the custom fields on your Lead object. Once submitted, the UTM data will be saved on the Lead.
The Web-to-Lead setup above captures first-touch attribution, but what about every touchpoint?
Heeet helps you go further by:
Instead of messy spreadsheets and disconnected tools, Heeet brings all your attribution data into one place right inside your CRM.
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 visualize the full customer journey from click to revenue
Ready to connect every touchpoint to revenue? Try Heeet for free or Book a Demo