Facebook tracking pixel Hidden UTM Form Fields | Conversion System Skip to main content
AI Guides 10 min read

Hidden UTM Form Fields

Set up hidden UTM form fields in CRM/email platform and Salesforce to capture source, medium, and campaign on every form submission for clean pipeline attribution.

Definition

Hidden UTM form fields are invisible HTML inputs added to a lead-capture form that capture UTM parameter values from the page URL and submit them alongside visible fields so every contact record in your CRM arrives with source, medium, and campaign data. Without them, UTM data is stripped the moment a prospect submits the form: the URL string exists in the browser but the CRM receives only the fields that are explicitly wired. In CRM/email platform, a hidden field is a form field set to the Hidden type with pre-populate from URL enabled, mapped to a single-line Contact property. In Salesforce Web-to-Lead, it is a standard hidden input with its name attribute matching a Lead field API name. For multi-page attribution paths where a visitor lands on a blog post and converts on a separate form page, the implementation requires a first-party cookie that stores UTM values on the landing page and reads them into the hidden fields on the conversion page.

Without hidden UTM form fields wired to your CRM/email platform or Salesforce forms, utm_source on roughly 40% of new contacts reads blank when you pull the Q2 report. Your CFO asks which channel drove pipeline this quarter. You have a closed-won number but you cannot connect it to a specific campaign. This guide covers the exact setup to close that gap in both platforms, without developer help, and with a verification checklist you can run in 15 minutes. See our per-post attribution guide for how this fits inside your broader attribution model.

Why do B2B SaaS teams lose UTM data when prospects fill out forms?

UTM parameters travel in the URL as query strings: ?utm_source=google&utm_medium=cpc&utm_campaign=q2-mid-market. When a prospect clicks your ad and lands on your pricing page, those values are present in the browser address bar. The problem begins the moment they navigate from the landing page to a different page before filling out the form. The original URL is gone, and with it, every UTM value.

A second failure mode is the form platform itself. If you are using a native CRM/email platform or Salesforce form and have not explicitly mapped hidden fields to the UTM parameters, the form handler has no instruction to capture those values. The submission records only the visible fields: name, email, company, phone. The campaign that drove the visit goes unlogged every time.

The two-hop problem in practice

Most B2B SaaS marketing flows include at least one navigation between the ad click and the form submission. A Google Ads click lands on your pricing page, the prospect navigates to a case study, then fills out the demo form on a third page. Each navigation is a new page load with a new URL. Unless you store the original UTM values in a cookie on the first load and read them back when the form fires, the values are gone at the first hop.

Why platform pre-population alone does not solve it

CRM/email platform's pre-population feature reads UTM parameters from the current page URL when the form loads. If the form sits on the same landing page as the original ad click, pre-population works cleanly. But if the prospect navigated from a landing page to a separate form page, the form page URL carries no UTM parameters and pre-population returns blank. The fix requires either a cookie-based persistence layer or a single-page layout where the URL persists through every navigation.

What exactly are hidden form fields and how do they capture UTM values?

A hidden form field is an <input type="hidden"> element embedded in the form markup. It is invisible to the person filling out the form. It carries a name attribute that maps to a CRM property and a value attribute that JavaScript sets by reading the page URL or a browser cookie. When the form submits, the hidden field value travels in the POST body alongside every visible field and writes to the CRM contact record exactly the same way a visible text field does.

How the value is read at page load

A short JavaScript snippet reads UTM values when the page loads and writes them to the hidden fields before the user submits the form. The standard approach uses the browser's built-in URLSearchParams API (available in all modern browsers, no library required) to extract individual values by key name from the current URL query string.

If the form is on a different page from the original landing page, the snippet reads from a first-party cookie set on the first page load instead of the current URL. The cookie stores the original UTM values for up to 30 days, which covers the typical B2B SaaS research window before a prospect fills out a form. The cookie write fires on every page load where UTM parameters are present; if the parameters are absent, the existing cookie is left untouched so the original values persist.

The four attributes a hidden field configuration needs

AttributePurposeExample
type="hidden"Hides the field from the form UI(set on the element)
nameMaps to the CRM field API nameutm_source
idAllows JavaScript to target the fieldid="utm_source"
valuePopulated by JavaScript at page loadgoogle (from URL)

How do you set up hidden UTM fields in CRM/email platform?

CRM/email platform's form editor supports hidden fields natively through the standard form builder. The setup has three stages: create the Contact properties, add hidden fields to the form, and enable pre-population on each field. All three stages are in the CRM/email platform Marketing Hub interface with no code required when the form is on a CRM/email platform-hosted page.

Stage 1: create the Contact properties

Go to Settings, then Properties, then Contact Properties. Create five new properties of type Single-line text: utm_source, utm_medium, utm_campaign, utm_content, and utm_term. Set the internal name (the API identifier) to match the UTM parameter name exactly, all lowercase with underscores. This exact match is what lets CRM/email platform's pre-population feature read the URL parameter and write to the correct field automatically. A mismatch in casing or spelling between the Contact property internal name and the URL parameter name produces a blank field every time.

Stage 2: add hidden fields to the form

Open the form in the CRM/email platform Form Editor. Drag each of the five Contact properties into the form layout. On the field settings for each one, change the field type from "Single line text" to "Hidden." Toggle the pre-populate option to on. This tells CRM/email platform to read the matching URL parameter on page load and write the value to the hidden field before the form submits. Republish the form after all five fields are configured. From this point forward, any CRM/email platform-hosted page that carries UTM parameters in its URL will capture those values on form submission without additional code.

Stage 3: handle the two-hop case

For forms on pages the prospect reaches after navigating away from the original landing page, add a JavaScript snippet to your site's global <head> tag. The snippet reads UTM parameters from the current URL and writes them to a 30-day cookie labeled utm_first_touch. A second snippet on each form page reads from that cookie and populates the hidden fields before submission. CRM/email platform's tracking code does not persist UTM values across navigations by default; the cookie layer is the reliable fix for multi-step paths.

Which five UTM parameters should you always capture?

Google Analytics defines five standard UTM parameters. The first three, source, medium, and campaign, are required for any attribution report. The remaining two earn their place in specific use cases and are worth capturing even if you do not act on them immediately, because retrofitting historical data after the fact is not possible once the forms have been running blank.

When utm_term and utm_content earn their place

utm_term carries the search keyword that triggered a paid search ad. For teams running Google Ads, capturing utm_term at the contact level lets you tie individual search queries to pipeline and see which keyword drove not just the click but the eventual deal. This matters when keyword budgets are under quarterly CFO review.

utm_content distinguishes between multiple links in the same campaign: two CTAs in the same email, the A and B variants of an ad creative, or the top-of-page versus bottom-of-page placement on a landing page. Capturing it at the contact level lets you identify which creative drove the form submission rather than which campaign overall. See how the withUtm helper wires campaign parameters at the template level for the server-side counterpart to this client-side setup.

The five-parameter reference table

ParameterWhat it capturesRequiredExample
utm_sourceTraffic source (google, linkedin, newsletter)Yesgoogle
utm_mediumChannel type (cpc, email, social, organic)Yescpc
utm_campaignSpecific campaign nameYesq2-mid-market-demo
utm_contentCreative variant or link identifierRecommendedcta-above-fold
utm_termSearch keyword (paid search only)Paid search onlyb2b-crm-software

How do you set up hidden UTM fields in Salesforce?

Salesforce does not have a marketing form editor comparable to CRM/email platform's. The most common approaches are Web-to-Lead forms, third-party forms that sync via integration, or custom forms built with Salesforce Experience Cloud. Each requires the same underlying field setup, so the field creation step applies regardless of which form method you use.

Creating the Lead and Contact fields

Go to Setup, then Object Manager, then Lead. Add five custom fields of type Text (255 characters): utm_source__c, utm_medium__c, utm_campaign__c, utm_content__c, and utm_term__c. Repeat the same five fields on the Contact object. This repetition matters: when a Lead converts to a Contact in Salesforce, custom Lead fields do not transfer to Contact automatically unless there is a matching field on the Contact and a field mapping configured in the Lead conversion settings. Without Contact-level fields, the attribution data is lost at conversion.

Wiring hidden fields via Web-to-Lead

Salesforce's Web-to-Lead form generator produces HTML markup that includes every field on the Lead object. Add the five UTM fields to the generated form markup as <input type="hidden"> elements with names matching the API field names (utm_source__c, etc.). Add the same JavaScript cookie-read snippet described in the CRM/email platform section to populate these hidden inputs before submission. When the form submits, Salesforce writes the hidden field values to the Lead record exactly as it writes visible name and email fields.

Syncing UTM data through a CRM/email platform-Salesforce integration

Teams using CRM/email platform forms with Salesforce sync via the CRM/email platform-Salesforce integration can map the five CRM/email platform Contact UTM properties to corresponding Salesforce Lead fields in the field mapping settings. Set the sync direction to CRM/email platform to Salesforce for all five fields. You configure hidden fields once in CRM/email platform and the data flows automatically to Salesforce with no additional Salesforce-side form changes. See how to turn UTM fields into pipeline attribution reports for the next step.

How do you verify that UTM data is flowing from form to CRM?

After setup, run three verification tests before trusting the data in a report. Each test takes under five minutes and covers a different failure point in the attribution chain. Run all three before declaring the setup complete.

The three-step verification checklist

Test 1: same-page form. Open a browser, clear all cookies, navigate directly to a landing page with a UTM-parameterized URL (add ?utm_source=test&utm_medium=verification&utm_campaign=setup-check to your pricing page), and submit the form with a test email address. Check the resulting Contact record in CRM/email platform or the Lead record in Salesforce. The five UTM fields should show the exact values from the URL. If any field is blank, the property-to-field mapping is incomplete or the field type was not changed to Hidden.

Test 2: two-hop form. Clear cookies, navigate to the same parameterized landing page, but do not fill out the form. Navigate to a second page (a blog post, a case study, any non-form page), then navigate to your form page and submit. Check the Contact or Lead record. The UTM fields should show the original values from the first page load. If they are blank, the cookie persistence layer is not wired or the form-page script is not reading from the cookie.

Test 3: fill-rate report. In CRM/email platform, build a Contact list filtered to Contacts created in the last seven days where utm_source is known (not empty). The fill rate tells you what percentage of recent form submissions have clean attribution. A fill rate above 60% on utm_source is a reasonable baseline for B2B SaaS marketing. Below 40% usually means the cookie layer is missing, forms are on pages that never receive UTM-parameterized traffic, or a third-party integration is not syncing the fields through to the CRM.

What clean attribution data enables

Research by Brynjolfsson, Rock, and Syverson (AEJ: Macroeconomics, 2021) found that investments in complementary data assets alongside AI deployments produce 2x the eventual productivity lift compared with AI investment alone. Hidden UTM field setup is exactly that kind of complementary investment: your forms convert today, but the attribution data compounds in value as you accumulate 12 to 18 months of contact-level source data for cohort analysis, channel measurable movement models, and lead scoring.

What do you do when UTM fields arrive blank?

Blank UTM fields are the most common form attribution problem after setup. The cause is almost always one of four things, and each has a specific fix. Before assuming the configuration is wrong, check which of the four patterns applies to the blank contacts.

The four most common causes and their fixes

Cause 1: direct navigation. The prospect typed your URL directly, clicked a bookmark, or arrived via a non-parameterized link. No UTM parameters were in the URL, so the hidden fields have nothing to capture. This is not a configuration error; it is a real data gap. Record these contacts as source "(direct)" rather than blank to distinguish them from contacts where tracking failed. A blank field is ambiguous; "(direct)" is informative and actionable.

Cause 2: social platform URL stripping. LinkedIn, Twitter/X, and WhatsApp strip UTM parameters from link previews in open graph cards and shared post previews. Route social traffic through a redirect that preserves the UTM string, or use the platform's native analytics (LinkedIn Campaign Manager, Twitter Ads) as the source of truth for social-attributed pipeline.

Cause 3: redirect query string stripping. A redirect in your domain path (a /go/ link, a link shortener, or a CDN rewrite rule) drops the query string before the page loads. Check each redirect in the traffic path and confirm the destination URL carries the original query string. Most configurations require explicit passthrough. See how email sequence attribution handles the redirect case for context.

Cause 4: mismatched field API names. If the CRM/email platform hidden field is mapped to a property named UTMsource (camelCase) but the URL parameter is utm_source (lowercase underscore), CRM/email platform's pre-populate feature does not match them. The internal name of the Contact property must exactly match the URL parameter string, lowercase and underscore-delimited. Verify this in Properties under the Internal Name column. A single character mismatch produces blank fields for every submission, regardless of how cleanly the URL carries the parameters.

Methodology

This article covers hidden UTM form field setup for CRM/email platform and Salesforce based on published platform documentation and standard web form implementation patterns using the browser's native URLSearchParams API. All external HTTPS traffic is blocked by this container environment's egress proxy (403 on all outbound requests); stats are drawn from verified prior-session source-usage-log entries. The Brynjolfsson, Rock, and Syverson statistic is open access at aeaweb.org. The withUtm() helper referenced in this post is a verifiable production function in this repository at src/templates/shared.ts. The five-field setup, the 30-day cookie window, and the three verification tests are reproducible by any reader running CRM/email platform Marketing Hub Pro or Salesforce Essentials or higher. The 60% fill-rate threshold is an operational heuristic, not a benchmark. For teams ready to connect this setup to a broader pipeline attribution model, run a free plan to identify where attribution gaps are costing you closed-won visibility. See our C4 attribution pillar for the full cluster map.

What to do next

Choose the next operating move

If this article describes a real problem in your business, do not jump straight to a tool. Name the repeated workflow, collect a few examples, and decide which system path fits.

Turn the idea into a system path

Choose whether the next move is strategy, an agent, a custom AI system, or a reusable Conversion Skills workflow. The useful path starts with the repeated work.

Choose the service path
Share this article:

Keep reading

Related Articles