How to capture UTM parameters in Gravity Forms

Capture UTM parameters in Gravity Forms and connect source journeys with lead quality and sales outcomes to see which marketing channels bring customers.

Augustinas Grupas

Creator of TrackLeadSource

9 min read

Summarize with:

Share:

To capture UTM parameters in Gravity Forms, add a Hidden field for each parameter, enable Allow Field To Be Populated Dynamically, and set the Parameter Name to the UTM key, such as utm_source. Gravity Forms then saves the values from the page URL with the entry. That works when the visitor lands on the page with the form. If they browse first, the tags are gone from the URL, and you need tracking that keeps them until the form is sent.

TL;DR

  • Hidden fields do the native job. Gravity Forms can copy UTM values from the form page's URL into the entry without asking the visitor anything.

  • Browsing breaks it. Once a visitor clicks to another page, the campaign tags are no longer in the URL. Keeping them needs a tracking script, which can also record return visits and the pages viewed.

  • Then connect it to customers. Save the source with each lead, add the sales outcome in your CRM, and you can see which channels bring customers rather than just form fills.

Add hidden UTM fields in Gravity Forms

A form entry that reads "Sarah, please call me back" is a lead. One that also says google / cpc / autumn_consultation is a lead you can learn from.

Gravity Forms has a Hidden field under Standard Fields. It is saved with the submission but never shown to the visitor. Set one up for each UTM value:

  1. Open your form and add a Hidden field.
  2. Give it a label you will recognise later, such as Campaign source.
  3. Open the field's Advanced tab and tick Allow Field To Be Populated Dynamically.
  4. In Parameter Name, enter the URL key, for example utm_source. Spelling and case must match the link exactly.
  5. Repeat for the other parameters and save the form.

These are the five standard parameters. Most teams start with the first three.

ParameterWhat it recordsExample
utm_sourceWhere the traffic came fromgoogle
utm_mediumThe type of marketingcpc
utm_campaignThe campaign nameautumn_consultation
utm_contentThe ad or link variationpricing_ad
utm_termThe paid keyword you put in the linkbusiness_consultant

The values come from your own links, so keep the naming consistent. Google and google will show up as two different sources. Google's campaign URL guide covers the naming rules.

To test it, open your form page with tags in the address, for example:

/contact/?utm_source=google&utm_medium=cpc&utm_campaign=autumn_consultation

Submit a test entry and open it under Forms → Entries. You should see google, cpc and autumn_consultation in the three fields, and nothing in content and term. The full settings are in Gravity Forms' dynamic population guide.

Why the UTM values disappear when visitors browse

The native method reads the URL of the page the form is on. Nothing more. That's fine when your ad sends people straight to the form. Most visitors take a detour first:

Google ad
→ /services/?utm_source=google&utm_medium=cpc&utm_campaign=autumn_consultation
→ /pricing/
→ /contact/  (form)

By the time they reach /contact/, the address has no tags. The hidden fields stay empty and the enquiry looks like it came from nowhere.

So before setting anything up, answer two questions:

Your situationWhat works
Ads and links point straight at the page with the formNative dynamic population is enough
Visitors land on other pages first, or come back laterYou need tracking that stores the source on arrival and fills the form when they submit

Hidden fields on their own only give the data somewhere to go. Something still has to remember the campaign between the first page and the form.

How TrackLeadSource keeps the source with the lead

TrackLeadSource is a lead source tracking tool built for exactly this gap. Once it is installed on your website, it records where each visitor came from: the UTM tags, click IDs such as gclid (Google Ads) and fbclid (Meta), and the referring site. It keeps that information while they browse and when they come back later. When they submit your Gravity Forms form, it fills your hidden fields, so the source is saved with the entry like any other answer.

It also records two things a single UTM value can't show.

Take someone who clicks your Google ad, reads the services page and leaves. Four days later they open your newsletter, click through, check pricing and send an enquiry. The entry then carries:

What is savedExample
Source journeyGoogle Ads → newsletter → enquiry
Pages visitedServices → pricing → contact
Campaignautumn_consultation, from the first visit

Your sales team sees that this person came from an ad, needed a reminder and looked at prices before calling. Marketing sees that the Google campaign started a conversation the newsletter finished. A UTM field filled from the contact page URL would have shown neither.

TrackLeadSource records what the browser makes available. It can't follow someone from their phone to their laptop, and a visit with no tags or referrer stays unknown rather than being guessed. More on the setup is on our Gravity Forms page.

TrackLeadSource

See the story behind each lead.

Keep source, campaign, and journey context together when a visitor becomes a lead.

Start free trial

14-day free trial. Cancel anytime

Google or Google Ads? Why you need UTMs and the referrer

"Source: Google" is half an answer. Was it a search result or an ad you paid for? The same goes for Facebook: an unpaid post and a Meta ad can bring very different leads at very different costs.

The referrer is the page that sent the visitor, as reported by the browser. It tells you the site, like google.com, but not whether the click was paid, and it is sometimes missing altogether (MDN explains why). UTM tags fill that gap, because you write the medium into the link yourself:

VisitSource / medium
Google organic search resultgoogle / organic
Google Ads clickgoogle / cpc
Unpaid Facebook postfacebook / organic_social
Meta adfacebook / paid_social
Link in a ChatGPT answerchatgpt.com / referral
Link in a Claude answerclaude.ai / referral
Reddit post or commentreddit / organic_social

The last three are worth watching: AI assistants and communities now send real leads, and you rarely control those links. ChatGPT usually adds utm_source=chatgpt.com to links in its answers, but not every click carries it, and some arrive with no referrer at all. Claude and Reddit mostly show up only through the referrer. Without tracking that reads both signals, a lot of these visits end up as "direct".

Tag every paid link and you can tell paid from organic. Skip it and a lot of your ad traffic will look like plain "Google" or "Facebook". A missing UTM isn't proof that a visit was organic, though, so it is better to leave the medium blank than to guess. Google's channel rules show how GA4 makes the same distinction.

Test the entry before you trust the report

A successful "Thanks, we'll be in touch" message doesn't tell you the source was saved. Run a labelled test enquiry through each path your visitors actually take:

  1. Straight to the form: open the tagged form URL, submit, and compare the entry with the URL.
  2. Browse first: land on a tagged service page, click through to the contact page and submit. This is the test the native method fails.
  3. Come back later: if you keep source data across visits, return through a different tagged link and check what the entry shows.
  4. In the CRM: find the same lead where your team works and check the values arrived. If a field is in the entry but not the CRM, it hasn't been mapped.

For the browse-first test, all three places should show the original campaign:

Where to checkSourceMediumCampaign
Landing page URLgooglecpcautumn_consultation
Gravity Forms entrygooglecpcautumn_consultation
CRM recordgooglecpcautumn_consultation

Why are the UTM fields blank?

Work out where the values stopped before rebuilding anything.

What you seeCheck first
Blank even when you open the tagged form URLParameter Name spelling, the dynamic population tick box, and whether a redirect stripped the tags
Works on the form page, blank after browsingNothing is keeping the campaign between pages
Works when you're logged in, blank for visitorsPage caching. Gravity Forms documents this: cached pages can serve the form without the URL values. Test logged out.
In the entry, missing in the CRMField mapping in your CRM add-on, Make or Zapier

Sometimes blank is the right answer: the visit simply had no tags. Don't relabel those as organic search.

Use the source data to decide where the budget goes

Saving the campaign is step one. It becomes useful once the sales result sits next to it.

In your CRM or spreadsheet, record whether each lead was a good fit, became a customer and what they spent. Then compare by source. Say one campaign brings 20 enquiries and another brings eight. If the eight include three customers and the 20 include one, the smaller campaign is the one to look at more closely, starting with its cost per customer.

The journey adds a second layer. If customers often start with a Google ad and come back through email, cutting the ad because it "doesn't convert on the last click" would remove the first step. Pages visited won't prove why someone bought, but they show what people read before getting in touch.

With source and outcome in the same sheet, you can also hand it to ChatGPT or Claude and ask: "Which sources bring leads that became customers, and which bring leads that never closed?" Our guide to measuring lead quality by marketing source walks through the comparison.

Common questions

No. The label is just for you. What matters is the Parameter Name in the Advanced tab, which must match the key in the URL. A field labelled Campaign source with utm_source as its Parameter Name works fine.

No. Gravity Forms reads the values straight from the page URL. GA4 is a separate tool for reporting on traffic and conversions.

No. It holds whatever keyword you put in the link. That is not necessarily the exact search the person typed, and if the link has no utm_term, there is nothing to show.

Yes. Hidden fields are invisible on the page, but anyone can edit them with browser developer tools (MDN). Treat them as marketing context, not proof of where someone came from.

Start with one form

Set up the hidden fields, run the browse-first test and check the lead in your CRM. If the campaign survives the trip, you're ready to compare channels by the customers they bring.

For the wider picture beyond tagged links, read our guide to tracking lead source in website forms. Or, to track lead source across visits and pages without rebuilding your forms, try TrackLeadSource free for 14 days.

Augustinas Grupas

Augustinas Grupas

Creator of TrackLeadSource

Helping marketers connect website form submissions to their source, campaign, and customer journey.

Keep reading

Know the story behind your next enquiry