To get UTM parameters into your CRM, you capture them in hidden form fields when someone submits a form, keep them stored while the visitor moves around your site, and map those fields to the lead record in HubSpot, Salesforce or whichever CRM you use. Once the values are on the lead, you can report on leads by campaign as well as visits by campaign.

Share post

How to Get UTM Parameters Into Your CRM: Salesforce, HubSpot and Forms

utm-parameters-crm

60-Second Summary

This guide follows a tagged ad click through to a demo request to show why UTM values must live on CRM records and how to capture them reliably. It explains hidden fields, cross‑page persistence, first‑ vs last‑touch logic, and the CRM mapping steps teams commonly miss.

  • Key takeaways: UTM values must be written to lead/contact/opportunity fields (via hidden form fields) so analytics and CRM outcomes can be joined; without them you cannot tell which channel truly produced sales-ready leads.

  • Standout strategies & tactics: Use hidden fields populated by a small script or GTM tag, persist UTMs in a first‑party cookie or localStorage so values survive multi‑page journeys, and name fields consistently across forms and CRM.

  • Real‑world lessons & frameworks: Decide first‑touch vs last‑touch before building (or store both as separate fields), map lead fields to Contact/Opportunity on conversion (Salesforce needs explicit mapping), and validate end‑to‑end with test submissions.

  • Implementation & common pitfalls: Keep UTM tagging consistent, choose a reasonable cookie expiry (30–90 days common), protect first‑touch fields from overwrites (CRM rules or fill‑only‑if‑empty), and complement form data with company‑level tools (e.g., Leadfeeder) to capture anonymous visitors.

*This summary was created with AI assistance, using our original content.

This guide follows one visitor from a tagged ad click to a demo request and shows what ends up in the CRM at each step. If you need a refresher on the tags themselves, start with our guide to UTM parameters.

Why UTM values belong in your CRM

Your analytics tool and your CRM answer different questions. GA4 reports visits by campaign: how many sessions the LinkedIn webinar campaign brought, how long people stayed, how many filled in a form. Our guide to the GA4 UTM report covers that side. The CRM holds the leads, and what happens to them after the form: whether sales accepted them, met them or opened opportunities from them.

Without UTM values on the lead record, the two never meet. GA4 says the webinar campaign produced 40 form submissions. The CRM shows 40 new leads with Lead Source set to Web. Nobody can say which of those leads came from the LinkedIn ad, which came from the reminder email and which came from somewhere else entirely, so nobody can say which campaign brought the leads sales wanted.

Putting the UTM values on each lead closes that gap. You can build a CRM report of leads by utm_campaign, filter opportunities by utm_source, and compare channels on the outcomes your sales team cares about.

How hidden form fields capture UTM values

The standard method uses hidden fields: form fields the visitor never sees, filled in automatically before the form is submitted.

You add one hidden field for each UTM parameter to every form you want to track. When the page loads, a small script reads the UTM values from the page address and writes each one into the matching hidden field. You can write that script yourself or set it up as a tag in Google Tag Manager. When the visitor submits the form, the hidden values travel with their name and email into your CRM, just like any visible field.

Name the hidden fields the same way in every form and in the CRM, such as UTM Campaign, so whoever builds a report later does not have to work out which of three similar fields is the right one. If the same form appears on many pages, set it up once and reuse it, rather than adding hidden fields page by page.

Here is what the hidden fields hold when someone arrives from the LinkedIn webinar ad, whose link is https://www.example.com/webinar/?utm_source=linkedin&utm_medium=paid_social&utm_campaign=webinar-b2b-analytics-2026-11&utm_content=video-ad-a.

Hidden field

Fills from

Example value

UTM Source

utm_source

linkedin

UTM Medium

utm_medium

paid_social

UTM Campaign

utm_campaign

webinar-b2b-analytics-2026-11

UTM Content

utm_content

video-ad-a

UTM Term

utm_term

empty for this link

Most form tools support hidden fields, including HubSpot forms, Salesforce web-to-lead forms and common WordPress form plugins. The values that land in these fields are only as consistent as the links behind them, which is why a set of UTM best practices matters as much as the form setup.

Keep UTM values when visitors move between pages

The basic setup has a gap. The UTM tags only exist in the address of the first page a visitor lands on. If they read the webinar page, click through to your pricing page and then fill in the demo form there, the tags are gone from the address and the hidden fields stay empty.

In B2B, that is the normal journey. Few people convert on the first page they see.

The fix is to store the values the moment the visitor lands, then fill the hidden fields from storage instead of from the address. Your script saves the UTM values when it finds them in the address, and on every later page it reads them back from storage and writes them into any form it finds.

There are two common places to store them. A first-party cookie is a small file your site saves in the visitor's browser; your server can read it, and you set how long it lasts. The browser's local storage holds the values in the browser only, with no expiry unless you add one in your script. Both keep the values on the visitor's own device.

Decide how long the values should last. A cookie that expires after 30 or 90 days is a common choice for B2B, while a value that never expires can credit a campaign for a form filled in a year later.

First touch or last touch: decide what you store

Decide this before you build, because it changes how the script behaves.

First touch stores the values from the visitor's first tagged visit and never overwrites them. Last touch overwrites the stored values every time the visitor arrives through a new tagged link. Neither is wrong; they answer different questions.

Take our example visitor. They first click the LinkedIn webinar ad, read two pages and leave. A week later they open a reminder email, click https://www.example.com/demo/?utm_source=newsletter&utm_medium=email&utm_campaign=webinar-b2b-analytics-2026-11&utm_content=reminder-1 and request a demo.

Model

What the CRM records for the demo request

First touch

linkedin, paid_social, video-ad-a

Last touch

newsletter, email, reminder-1

First touch tells you which campaign introduced the person to you. Last touch tells you which one brought them back to convert. In B2B, both are worth knowing, so store both: one set of fields such as "UTM Campaign (first touch)" that is written once and never changed, and one set such as "UTM Campaign (last touch)" that updates on every tagged visit. It costs five extra fields and saves a long argument later about which campaign gets the credit.

How to get UTM data into HubSpot

HubSpot records some source information on its own. Its tracking code sets an original source and a latest source for each contact, with drill-down properties that add detail. For visits that arrive through tagged links, HubSpot uses the UTM values to fill some of those properties.

According to HubSpot's knowledge base page on traffic source properties, last updated on 4 August 2026, each contact has an Original Traffic Source and a Latest Traffic Source, each with two drill-down properties. HubSpot fills the drill-downs from the UTM values: for paid and organic social, drill-down 1 is the social network and drill-down 2 is the utm_campaign value, and for email marketing, drill-down 1 is the utm_campaign value and drill-down 2 is the utm_content value.

Before you create new properties, check whether your portal already has UTM properties from an earlier setup or an integration, so you do not end up with two sets of fields holding the same values.

The built-in properties summarise where a contact came from, but they do not give you every UTM value as a field you can filter and report on. To capture all five:

  1. Create a custom contact property for each UTM parameter, plus first-touch and last-touch versions if you store both.

  2. Add matching hidden fields to each HubSpot form, mapped to those properties.

  3. Set each hidden field to fill from the page address, or from the stored value if your script keeps UTM values between pages.

  4. Submit a test form from a tagged link and check that every property on the test contact is filled.

Once the properties exist, you can build HubSpot reports and lists by campaign, and compare the campaigns that bring contacts with the ones that bring deals.

How to get UTM data into Salesforce

In Salesforce, the steps are similar, with one extra step that catches most teams out.

  1. Create a custom field on the Lead object for each UTM value, such as UTM Source, UTM Medium and UTM Campaign, with first-touch and last-touch versions if you store both.

  2. Add hidden fields to your web-to-lead form, or to the form in your form tool, that write to those lead fields.

  3. Map each custom lead field to a matching custom field on the Contact, Account or Opportunity object.

  4. If you use Salesforce campaigns, add new leads to the matching campaign so they appear in campaign reports.

Step 3 is the one people miss. When a lead is converted, Salesforce only carries custom lead fields across to the contact, account or opportunity if they are mapped. Unmapped fields stay on the converted lead record, which most reports never look at, so the UTM data seems to disappear. Create the matching fields on the other objects first, then map each lead field to its partner. Then test the whole chain with one lead: submit a form from a tagged link, convert the lead and check that the UTM values appear on the contact and the opportunity.

In Salesforce Setup, open the Object Manager, choose the Lead object, go to Fields & Relationships and click Map Lead Fields, as Salesforce's help page on mapping custom lead fields for lead conversion describes (checked on 22 October 2026).

If you use Account Engagement (previously Pardot) for your forms, the method is the same: hidden fields mapped to prospect fields. For first-touch fields, the values stored in the visitor's browser stay the same on every form, so the form keeps sending the first-touch values.

A visitor who comes back on a different device starts with empty storage, though, and their next form can overwrite the first-touch fields. To guard against that, add a rule in your CRM that only fills a first-touch field when it is empty, such as a record-triggered flow in Salesforce.

Other CRMs and form tools

The method works in any CRM that accepts custom fields from a form, including Pipedrive, Zoho CRM, Marketo and Microsoft Dynamics. The steps are the same everywhere: create custom fields for each UTM value, add hidden fields to your forms, store the values between pages and map the fields so they survive any conversion from lead to contact.

The chain starts with the link. If your LinkedIn campaigns are tagged inconsistently, every CRM report built on them inherits the mess. Our guide to LinkedIn UTM parameters covers how to tag ads and posts so the values arrive in the same format every time.

Visitors who never fill in a form

This whole setup only works for visitors who submit a form. In B2B, most of the people researching you never do. They read your pricing page, compare you with two other vendors and pass a recommendation to a colleague, and their campaign data never reaches the CRM.

Leadfeeder reads a website at company level, so Web Visitors lets you see which companies visit your site, by name, including the ones that never fill in a form. Comparing the companies a campaign brought with the leads it created shows how much of the campaign your CRM report does not capture.

Frequently asked questions

How does HubSpot use UTM parameters to categorize traffic?

HubSpot's tracking code reads the UTM values on a tagged visit and uses them to fill the contact's source properties, such as the original source and its drill-down details. To report on every UTM value, including utm_content, create custom contact properties and fill them with hidden fields on your forms.

For social traffic, for example, the utm_campaign value becomes the second drill-down, so a contact who arrived from the webinar ad shows webinar-b2b-analytics-2026-11 there.

How many UTM parameters should I use?

Use utm_source, utm_medium and utm_campaign on every tagged link, and add utm_content when you want to compare ads or placements within a campaign. utm_term is mainly for paid search keywords. For your CRM, capture all five in hidden fields anyway, so the fields are ready when a link does use them.

What happens to UTM parameters when a visitor leaves and comes back?

If you only read UTM values from the page address, they are lost as soon as the visitor clicks to another page or leaves. Store them in a first-party cookie or local storage when the visitor lands, and fill your hidden fields from storage. Decide whether a return visit overwrites them or not.

Should I store first-touch or last-touch UTM values?

Store both, in two sets of fields. First touch records the campaign that introduced the visitor, and last touch records the one that brought them back to convert. In B2B, where people often visit several times before filling in a form, the two are frequently different, and each answers a different question.

Why do UTM fields disappear when a Salesforce lead converts?

Salesforce only copies custom lead fields to the contact, account or opportunity when they are mapped. Unmapped UTM fields stay on the converted lead record, which most reports ignore. Create matching fields on the other objects and map each lead field to its partner in Salesforce Setup before the next lead converts.

Can I add UTM values to leads that already exist in my CRM?

Not reliably. UTM values are captured at the moment of the visit, so leads created before you set up hidden fields have no record of them. For existing leads, use whatever source information your CRM already holds, and start capturing UTM values on every form from now on so new leads arrive complete.

Use the free UTM builder to create UTM links in one consistent format, so the values your CRM receives are easier to report on.

Generate quality leads from website traffic

Jamie Headshot Square

Director of Demand @ Leadfeeder

Jamie Pagan is Director of Demand at Leadfeeder, where he leads demand generation and pipeline growth initiatives. His work focuses on connecting marketing activity with revenue by combining intent signals, campaign performance data, and audience insights.

With experience building scalable demand engines and launching growth-focused campaigns, Jamie brings a practical perspective on how marketing teams generate and capture demand. His experience working with intent data and marketing analytics informs his approach to identifying high-intent buyers and converting interest into qualified opportunities.

Related articles