Getting UTMs Into Your CRM (and Keeping Them There)
The lead converted, the deal closed, and nobody knows which campaign started it. How to capture UTM parameters into HubSpot or Salesforce hidden fields.
Analytics tells you about traffic. The CRM decides budgets.
GA4 can tell you utm_campaign=spring-launch drove 4,000 sessions. It can't tell you those sessions became $180K in closed deals, because revenue lives in the CRM and the CRM never heard about the campaign. Somewhere between the click and the opportunity record, the UTM data fell on the floor.
This is the most expensive data loss in B2B marketing, and it happens by default. The fix is unglamorous: carry the parameters from the URL into the form, from the form into the contact record, and protect them from being overwritten. Each step has a failure mode. Let's walk them.
Step 1: URL to form
The lead lands on your page with UTMs in the URL. Your form needs to capture them into hidden fields at submit time. Three ways teams do it:
Native platform capture. HubSpot forms grab "original source" data automatically, but its buckets are HubSpot's, not your UTM taxonomy. For your actual parameter values you still want explicit hidden fields mapped to contact properties.
A snippet that reads the URL. A few lines of JavaScript that pull utm_* from the query string and stuff them into hidden inputs. Works until someone rebuilds the landing page and forgets the snippet. If your form capture does this automatically on every form, that entire failure mode disappears, which is why we built it in.
Salesforce Web-to-Lead with hidden fields mapped to custom Lead fields (Lead_Source_Detail__c and friends). Same idea, more XML.
Step 2: surviving the browse
Here's the failure mode almost everyone ships: the visitor lands on the blog with UTMs, reads, clicks to the pricing page, and fills the form there. The pricing page URL has no parameters. The hidden fields capture nothing. Your best-researched leads, the ones who looked around before converting, are exactly the ones who lose attribution.
The parameters have to persist across the session, not just the landing page. Store them in sessionStorage or a first-party cookie on first touch, and have the form read from storage rather than the current URL. This one change typically doubles the share of leads with attribution. When we audit CRMs with 60% "unknown source" leads, missing persistence is the cause more often than everything else combined.
Step 3: first touch, last touch, don't overwrite
A contact fills three forms over two months. Webinar (utm_source=linkedin), then a guide (google), then the demo request (email). If each submit overwrites the UTM fields, your CRM now says email sourced the deal. Email closed it. LinkedIn sourced it. Those are different budget lines.
Store both: a set of first-touch fields written once and locked, and last-touch fields that update per submission. In HubSpot that's property settings. In Salesforce it's a bit of flow logic that only writes empty first-touch fields. Boring to set up, and it ends the sales-vs-marketing sourcing argument permanently, which alone is worth the afternoon.
Step 4: garbage in, garbage forever
The CRM is where UTM sloppiness becomes permanent. GA4 data ages out. That "utm_source=LinkedIN-paid" typo on a closed-won deal sits in Salesforce for the life of the account, breaking every revenue-by-source report forever.
Which means CRM capture raises the stakes on naming discipline. Values need to come from a governed builder, not freehand typing. And keep the raw values raw: resist the urge to "clean" them inside the CRM with formula fields. Normalize at link creation, capture verbatim, and the two systems will actually agree when you cross-check.
The payoff report
Once parameters flow, the report that justifies the whole exercise is three columns: utm_campaign, pipeline created, revenue closed. Not sessions. Not MQLs. Money by campaign.
The first time that report runs, expect a surprise. Teams discover their highest-traffic campaign produces thin pipeline while some ignored channel quietly closes. That reallocation conversation is the entire point of attribution, and it only happens when the UTM survives the full trip from tagged link to closed deal.