Skip to content

How to Track UTM Parameters in Salesforce

Website analytics shows which campaigns bring visits. Salesforce reporting needs the same origin attached to each lead, opportunity and closed deal. The workflow below connects those two views: classify the visit, preserve it across pages, write it into hidden form fields, and report on it inside the CRM.

A four-step setup checklist

Start with the decision you want Salesforce to answer: which channels and campaigns create leads, opportunities and revenue, not just visits. That goal determines the fields you need. A practical setup has four parts: a site snippet that classifies each visit, hidden fields on lead forms, automatic population at submission, and CRM reporting on the stored values. Before adding anything, list the exact field names you will map in Salesforce and check that your form builder can create hidden fields. Most modern builders let you drag in a hidden field type; a hand-built HTML form can use a hidden input type instead.

From snippet to submitted lead

Step 1: add the snippet through your site settings or header area, following builder-specific guidance for WordPress, Webflow, Squarespace or your platform. Step 2: add six hidden fields to every lead-capture form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group. Step 3: let the tool fill those fields when the form is submitted, using the visit classification rather than asking the visitor to type anything. Step 4: confirm the form-to-Salesforce connection passes the hidden values with name, email and phone, then build a test submission and verify each field in the CRM record before rolling out to all forms.

Worked example: reading the drilldowns

Consider a paid-search brand campaign. The hidden fields might read: Channel = Paid Search, Drilldown 1 = Google, Drilldown 2 = Brand Campaign, Drilldown 3 = the brand name used in the ad setup. The same submission also records the first landing page, for example a product-features URL, and its group, such as Features. That example shows why drilldowns matter: the top-level channel tells you the broad source, while each drilldown narrows it to network, campaign and ad detail you can act on. Values depend on the UTM parameters actually used behind the ads, so standardise naming before launch.

Why classification beats raw UTM capture alone

Raw UTM capture has two gaps. First, organic visits from search, social, referral or direct traffic carry no UTM parameters, so those leads arrive unattributed. Second, parameters in a URL disappear if the visitor browses to another page before completing a form. Storing the classification in a browser cookie solves the second gap: the data persists across pages until submission. Classifying every visit solves the first: each lead gets a channel whether or not it came from a tagged ad. The tool also stores click IDs — GCLID, MSCLKID and FBCLID — which can later be returned to Google, Microsoft or Meta as offline conversions when a contact becomes a customer.

Four reports to build first

Once data lands in Salesforce, four reports cover most budget decisions. Leads by channel shows where demand originates across paid and organic sources, revealing mismatches such as heavy paid spend alongside dominant organic leads. Leads by social network separates Facebook, Instagram and Messenger performance. Customers by Google Ads campaign compares monthly customer counts rather than clicks. Revenue by keyword — available when keyword values are included in Google Ads UTM parameters through tracking templates — shows which search terms produce income and which deserve higher bids or SEO attention. Build these in Salesforce reports or export to your BI tool, then review conversion to opportunity and closed-won deals by the same fields.

Check content performance and test before launch

Use landing-page fields as a content check. If a blog post or long-form guide is meant to generate demand, the landing page and group values on its leads tell you whether it does. Pair that with channel data to distinguish content that attracts visitors from content that attracts buyers. A final quality pass helps: submit test forms from a tagged ad, an organic search visit and a direct visit; confirm all three produce sensible channel values; and confirm the values survive navigation to a different form page. That test catches most mapping errors before real leads are affected.

Hidden-field map for Salesforce attribution
Hidden fieldWhat it recordsUse it to answer
ChannelBroad source such as Paid Search or Organic SearchWhich channel creates the most leads?
Channel Drilldown 1Network or platform detail such as GoogleWhich platform within the channel performs best?
Channel Drilldown 2Campaign-level detailWhich campaign drives customers?
Channel Drilldown 3Ad-level detailWhich ad or keyword produces revenue?
Landing PageFirst page the visitor arrived onWhich entry page starts the journey?
Landing Page GroupCategory of that first page, such as FeaturesWhich content area generates demand?

Field list as specified for lead-capture forms; example values depend on the UTM parameters used in campaigns.

Starter Salesforce reports
ReportPrimary dimensionDecision it supports
Leads by ChannelChannelRebalance spend between paid and organic
Leads by Facebook Ads NetworkSocial networkFocus targeting on the strongest network
Customers by Google Ads campaignCampaign and monthShift budget toward campaigns producing customers
Revenue by KeywordKeyword from UTM parametersSet bids and prioritise SEO topics

Report types described for use once attribution fields are stored in Salesforce.

Frequently asked questions

What are the basic steps to get UTM data into Salesforce?

Add a small site snippet, create hidden fields on each lead form for channel, drilldowns, landing page and landing page group, let the tool populate them at submission, and map those fields through your existing form-to-Salesforce connection so the values arrive with the contact details.

Why can raw UTM capture miss leads?

Raw UTM capture only works when the parameters are still in the URL on the form page. Storing the attribution in a browser cookie preserves it when a visitor moves from a campaign landing page to a separate contact page, and classification also covers visits without UTM parameters.

Which hidden fields are needed?

Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group. The drilldowns carry progressively finer detail such as network, campaign and ad-level values derived from your UTM values.

What click IDs can be captured alongside UTM data?

GCLID, MSCLKID and FBCLID can be stored with the submission. If the contact later becomes a customer, the relevant click ID can be sent back to the ad platform as an offline conversion.