Skip to content

Capture UTM parameters in Netlify forms

When a visitor submits a form, the useful question is not only who they are, but how they arrived. This guide explains how to attach campaign and landing-page attribution to every Netlify form submission, so leads can be compared by channel, campaign, and entry page in a CRM or spreadsheet.

How the capture flow works

Attribution works in two parts: first, browser-side code records how the visitor arrived; second, hidden form fields carry that record into the submission. Once both parts are in place, the values travel with the name, email, and other details the visitor entered, and can be forwarded to a CRM, spreadsheet, or email tool for reporting.

Four setup steps

  1. Add the supplied snippet to the head of the site, directly or through Google Tag Manager. 2. Add six hidden fields to each form: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group. 3. Let the browser code populate those fields automatically. 4. Submit a test form and confirm the attribution values appear alongside the visible answers. For third-party builders such as Typeform or Jotform, use the builder-specific hidden-field guidance; for HTML forms handled by Netlify, add the fields to the form markup.

Worked example: from click to submission

Consider a visitor who clicks a paid search ad, lands on a features page, browses elsewhere, and then requests a demo. The captured record might show Channel as Paid Search, the first drilldown as the search engine, the next two drilldowns as campaign and ad, plus the exact landing page and its group. That structure separates the broad channel from the specific campaign and the page that first attracted the visitor.

Why normalised attribution beats raw UTMs alone

Raw UTM capture has three gaps this approach closes. It records every lead, including organic search, organic social, referral, and direct arrivals, not only tagged paid clicks. It persists across pageviews and sessions, so moving from a landing page to a separate contact page does not lose the original campaign. And it normalises messy tagging — for example, facebook and fb variants can be grouped under Paid Social instead of appearing as separate sources. Landing page and landing page group are captured as well, so content performance can be reported at both the individual page and section level.

Reports to build after setup

Use the captured fields to answer four practical questions. Leads by Channel shows where demand originates and whether budget matches the strongest channels. Leads by Facebook Ads Network compares Facebook, Instagram, Messenger, and other Meta placements. Customers by Google Ads Campaign separates campaigns that produce paying customers from those that only produce visits. Revenue by Keyword, when keywords are included through Google Ads tracking templates, links spend to revenue and informs both bidding and SEO priorities.

Pre-launch checklist

Before going live, check each form type separately: confirm the hidden fields exist, submit from a tagged landing page, submit from a different page than the landing page, and submit from an untagged organic arrival. Verify that channel, drilldowns, landing page, and landing page group are present in the forwarded record and that no visible field was altered. Repeat the check after any form-builder or template change.

Hidden-field map for Netlify forms
Hidden fieldWhat it recordsReporting use
ChannelBroad origin such as Paid Search or Paid SocialLeads by channel
Channel Drilldown 1First level of detail, such as the platformNetwork or source comparison
Channel Drilldown 2Second level, such as campaignCampaign performance
Channel Drilldown 3Third level, such as adAd-level drilldown
Landing PageExact first page visitedIndividual page performance
Landing Page GroupSection of the landing page, such as /featuresSection-level performance

Field names are as listed in the supplied guide; exact form markup must come from the owner-supplied instructions.

Four reports to build from captured attribution
ReportDecision it supports
Leads by ChannelReallocate budget toward channels producing leads
Leads by Facebook Ads NetworkFocus Meta spend on the strongest network
Customers by Google Ads CampaignShift spend toward campaigns producing customers
Revenue by KeywordAdjust bids and SEO priorities by keyword value

Example reports described in the supplied guide; no example figures are reproduced.

Frequently asked questions

Where does the site code go?

Place the supplied snippet in the head of the site, either directly in the main site files or through a tag manager such as Google Tag Manager if that is how the site is managed.

Which hidden fields are needed and how do they differ by form type?

Add Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group as hidden fields. For a third-party builder, follow that builder's hidden-field instructions; for an HTML form handled by Netlify, add the fields to the form markup.

Does capture fail if the form is not on the landing page?

No. Attribution is stored in the browser, so it can still be attached when the form is on a different page from the landing page, and it also covers organic and direct arrivals rather than only tagged paid clicks.

What happens after a form is submitted?

Send the submission onward with Netlify's native integrations or Zapier to a CRM, spreadsheet, email marketing tool, or other destination, then report on the captured channel, drilldown, landing page, and landing page group fields.