Save UTM parameters with Gravity Forms entries

  • gravity-forms
  • utm
  • campaign-tracking
  • forms
  • hidden-fields

Updated

To save UTM parameters with Gravity Forms entries, add a Hidden field for each parameter, check Allow field to be populated dynamically, and enter the parameter name, such as utm_source. Every lead then shows which campaign brought it in.

UTM parameters are the tags you add to a link so you know where visitors came from. For example:

https://example.com/spring-offer/?utm_source=newsletter&utm_medium=email&utm_campaign=spring-offer

Which UTM parameters can I save?

Parameter Typical use Example
utm_source Where the link was posted newsletter, facebook, google
utm_medium The kind of traffic email, social, cpc
utm_campaign The campaign name spring-offer
utm_content Which link or ad version header-button
utm_term The paid search keyword kitchen remodel

Google Ads adds a gclid value to ad links on its own when auto-tagging is on. You can save that too.

Add hidden fields to your form

  1. Go to Forms and open the form, usually your contact or quote form.
  2. Add a Hidden field and label it UTM Source.
  3. In the field settings, open the Advanced tab.
  4. Check Allow field to be populated dynamically.
  5. In Parameter Name, enter utm_source, all lowercase, exactly as it appears in your links.
  6. Repeat for each parameter you want to keep: utm_medium, utm_campaign, utm_content, utm_term, or gclid.
  7. Save the form.

Visitors never see hidden fields. Their values appear with the rest of the entry under Forms → Entries, and you can include them in notification emails with merge tags.

How do I test it?

  1. Open a private (incognito) window.
  2. Visit the page with your form and add test parameters to the address, for example ?utm_source=test&utm_campaign=utm-check.
  3. Submit the form.
  4. Open the entry under Forms → Entries. The hidden fields should show test and utm-check.

Build campaign links

Use the same lowercase spelling every time: facebook and Facebook count as two different sources. Google's free Campaign URL Builder puts links together for you.

Don't add UTM parameters to links between pages on your own site. They only belong on links that bring people in from elsewhere.

On a Dirigible site

With Gravity Forms active, Dirigible fills these fields for you even when the visitor arrives on one page and submits a form on another.

  • It remembers the first campaign. When a visitor arrives from a link with utm_source, utm_medium, utm_campaign, utm_content, utm_term, or gclid, Dirigible saves those values in a cookie for 90 days. Later visits from a different campaign don't replace them, so the entry shows the campaign that first brought the visitor in.
  • It works with cached pages. The values are filled in by the visitor's browser, so page caching doesn't remove them.
  • It respects the cookie banner. If the GDPR Banner is on, nothing is saved until the visitor accepts cookies. Until then, only parameters on the current page's address are used.
  • It lists the names. The Form Parameters panel on your Dashboard's welcome screen shows every parameter name Dirigible can fill.

Use only those parameter names for Dirigible's remembering to apply. Other names still work with Gravity Forms' own dynamic population, but only when the parameter is in the address of the page with the form.

When you test, use a new private window each time. An earlier test's values are remembered and take priority over new ones.

To see hidden fields on the live form while you test, turn on Debug Hidden Fields under Appearance → Customize → Settings → Gravity Forms. Only administrators see them. Turn it off when you're done.