Blog
/
Salesforce UTM Tracking : How to do it in 2025

Salesforce UTM Tracking : How to do it in 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.

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_source
  • utm_medium
  • utm_campaign
  • utm_term
  • utm_content
  • and optionally gclid, fbclid, etc.

These fields should be created as custom fields on the Lead object in Salesforce.

Step 2: Use Cookies to Store UTM Data

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]);
 }
});


Step 3: Map the Fields in Salesforce

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.

Going Beyond: Multi-Touch Attribution in Salesforce

The Web-to-Lead setup above captures first-touch attribution, but what about every touchpoint?

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.

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 visualize the full customer journey from click to revenue

Ready to connect every touchpoint to revenue? Try Heeet for free or Book a Demo

Similar posts

Check out related blog articles