🙌 Our latest webinar is live!
Nov 7
Guides

How to Pass UTM Parameters Into Your CRM (Hidden Fields)

Andre Sottil
Founder & CEO, Admira

To pass UTM parameters into your CRM, add hidden fields to every lead form (utm_source, utm_medium, utm_campaign, utm_content, utm_term, plus click IDs like gclid and fbclid), fill them from the landing-page URL or from values you stored when the visitor first arrived, and map each hidden field to a matching contact property in the CRM. When the form is submitted, the campaign data travels with the lead. Without that last step, the UTMs die on the first page view and your CRM shows "Direct" or "Website" for leads that came from paid ads.

This guide covers the field setup, the capture logic, platform specifics for HubSpot and Kommo, a test checklist, and the cases where hidden fields are not enough.

Why don't UTM parameters reach the CRM on their own?

UTM parameters live in the URL. A visitor lands on yoursite.com/demo?utm_source=meta&utm_campaign=q4_demo, clicks to a pricing page, then fills the form on a third page. By then the URL has no UTMs. Unless something saved them, the form submits name, email and phone, and the source is lost. Analytics tools like GA4 keep the session source, but they don't write it onto the lead record in your CRM, which is where revenue is recorded.

Many CRMs record their own "original source" for forms they host, but those values are usually coarse (Paid Social, Organic Search) and won't tell you which campaign, ad set or ad produced the deal. Hidden fields give you that detail. If your UTMs themselves are inconsistent, fix that first with our UTM naming convention guide.

Which hidden fields should you create?

Create one CRM property and one hidden form field per parameter. Use the same internal name in both places to make mapping obvious.

Hidden fieldCRM property typeExample valueWhy it matters
utm_sourceSingle-line textmetaPlatform or referrer
utm_mediumSingle-line textpaid_socialChannel type
utm_campaignSingle-line textq4_demo_mxCampaign-level reporting
utm_contentSingle-line textvideo_testimonial_v2 or the ad IDCreative-level reporting
utm_termSingle-line textattribution softwareKeyword or audience
gclidSingle-line text(long Google click ID)Upload offline conversions to Google Ads
fbclidSingle-line text(Meta click ID)Match leads back to Meta via Conversions API
landing_pageSingle-line text/demoWhich page converted the visit
first_touch_* (optional)Single-line textsame fields, first visit onlyCompare first-touch vs last-touch

Use text properties, not dropdowns. HubSpot's documentation notes that for dropdown and radio fields, values in the query string must match the property's options exactly, so any new campaign name would fail silently.

How do you set up UTM hidden fields, step by step?

  1. Agree on a naming convention for source, medium and campaign values, written down and shared with the agency.
  2. Create the CRM properties from the table above on the contact (and, if your CRM uses them, on the deal or lead object).
  3. Add the hidden fields to every form: demo request, contact, quote, download, chat pre-form. A form without them becomes a hole in your reports.
  4. Capture the values on landing. When a visitor arrives with UTMs or click IDs in the URL, save them in first-party storage (a cookie on your domain or localStorage). Save first-touch values once and overwrite last-touch values on each new tagged visit.
  5. Populate the fields when the form loads, reading from the URL first and from storage second. Tag managers, form plugins or a short script from your developer can do this.
  6. Tag every ad. In Meta Ads Manager, put parameters in the ad's URL parameters field and use dynamic values such as {{campaign.name}}, {{adset.name}}, {{ad.name}} and {{ad.id}}. In Google Ads keep auto-tagging on so gclid is added, and use ValueTrack values like {campaignid} and {creative} in a tracking template.
  7. Test before launch with the checklist below.
  8. Build the report: leads, qualified leads, deals and revenue grouped by utm_campaign and utm_content.

How do hidden fields work in HubSpot?

HubSpot supports this natively. According to HubSpot's knowledge base article on hidden form fields, you open the field in the form editor and turn on the Hidden field toggle, and hidden fields can capture URL parameters such as UTM values and store them in contact properties on submission. The feature is available on all plans. Points to know:

  • A field marked Required cannot be set as hidden.
  • If "Pre-populate fields for returning visitors" is on, a returning contact's stored value may overwrite the hidden value, depending on field type.
  • HubSpot's article on auto-populating fields through a query string says fields populate when the URL contains the property's internal name and a value (for example ?utm_campaign=q4_demo), that dependent fields can't be filled this way, and that the page needs HubSpot content or the HubSpot tracking code.

The query string only exists on the landing page. If people browse before converting, you still need the storage step (step 4) to carry values to the form page.

What about WhatsApp leads in Kommo?

Click-to-WhatsApp ads don't involve a web form, so hidden fields don't apply. Kommo handles this differently. Its help article on tracking WhatsApp ad campaigns with UTMs says you add parameters in Meta Ads Manager under the ad's Tracking, URL parameters section, and Kommo saves them on the lead card under Statistics, Tracking data. It supports utm_source, utm_medium, utm_campaign, utm_content, utm_term, custom parameters, and dynamic placeholders such as {{campaign.name}}, {{adset.id}} and {{ad.id}}. Kommo also notes that changes can take up to 6 hours to appear, that changed parameters don't overwrite values already saved on a lead, and that the lead is only created after the person sends a message. For the full WhatsApp picture, see our guide to WhatsApp ads attribution.

Worked example: what hidden fields change in your report

Example (hypothetical numbers): a clinic spends $8,000 a month across three Meta campaigns. Before hidden fields, the CRM shows 320 leads with source "Website form" and 24 sales. Nobody can say which campaign produced the sales, so budget is split by cost per lead.

CampaignSpendLeadsCost per leadSales (from CRM)Cost per sale
promo_discount$3,000180$16.676$500
testimonial_video$3,00090$33.3312$250
before_after$2,00050$40.006$333

After hidden fields, the "cheapest" campaign by cost per lead is the most expensive by cost per sale. Moving budget from promo_discount to testimonial_video is now a data decision. This is the same logic behind measuring cost per sale instead of cost per lead.

How do you test that UTMs are reaching the CRM?

  • Open a tagged URL in a private window, browse two pages, then submit the form. Check every property on the new contact.
  • Repeat on mobile Safari and inside the Instagram and Facebook in-app browsers.
  • Test each form, including pop-ups and embedded forms on other domains.
  • Check that redirects (for example http to https, or a link shortener) don't strip the query string.
  • Submit twice from the same browser with different UTMs and confirm first-touch stays and last-touch updates.

Where hidden fields break down

  • Cookie lifetime in Safari. WebKit's Intelligent Tracking Prevention 2.1 caps cookies created by JavaScript (document.cookie) at seven days. A visitor who returns after eight days may arrive with no stored source. Server-set cookies or server-side tracking help; see what server-side tracking fixes.
  • Cross-domain journeys. If the ad lands on one domain and the form lives on another, storage doesn't follow unless you pass parameters in the link.
  • Phone calls and chat. A lead who calls or messages never touches the form.
  • Only one touch. Hidden fields record first and last touch, not the full sequence of visits in between.
  • Human error. One form missing the fields, or one untagged ad, creates a gap that looks like "Direct" traffic.

An attribution platform fills these gaps by tracking visits across sessions and joining them to the CRM record. Admira's lead tracking does this with cookieless tracking by default and native connections to HubSpot, Salesforce, Kommo, Clientify and ActiveCampaign, with no engineering required. Hidden fields are still worth setting up as a backup, because they keep the source on the lead even if you change tools later.

Who this is for, and when it doesn't apply

For: teams that generate leads through web forms and close deals in a CRM, and agencies that need to show clients which campaigns produced revenue.

Doesn't apply: pure ecommerce checkouts, where the order platform already records the source, and businesses whose leads arrive only by phone or WhatsApp, where call tracking or chat attribution does the job.

FAQ

What are hidden fields in a form?

Fields that are submitted with the form but not shown to the visitor. They carry data like UTM values, click IDs and landing page into the CRM.

Do I need a developer to pass UTMs into my CRM?

Not always. HubSpot fills hidden fields from the query string natively. Carrying values across several pages usually needs a small script, a tag manager setup or an attribution tool.

Should I store first-touch or last-touch UTMs?

Both. First touch shows which campaign created demand; last touch shows which one converted it. Store them in separate properties.

Why do my leads still show as Direct?

Usually an untagged ad, a redirect that strips parameters, a form without hidden fields, or a visitor who returned after the stored values expired.

Should I capture gclid and fbclid too?

Yes. Click IDs let you send closed deals back to Google Ads and Meta as offline conversions. See how to connect offline conversions.

Can I use dropdown properties for UTM values?

Avoid it. HubSpot requires query-string values to match dropdown options exactly, so any new campaign name would not be saved. Use single-line text.