Gravity Forms integration

How to track the source of your leads in Gravity Forms.

Dynamic Population is the feature everyone points you at for this. Here is what it does, and what still has to happen before it works.

Works with every Gravity Form on your site No hidden fields to configure Live in minutes

Integrates with the tools you already use.

Salesforce
HubSpot
Pipedrive
Gmail
Twilio
Google Ads
Gravity Forms
Jotform
Webflow
Wix
Calendly
Typeform

Works with all Gravity Forms features

Single-page forms Multi-page Conditional logic AJAX submissions Payment forms Popup & modal
Two ways to run it

Two ways to run it on Gravity Forms.

Install the free official plugin and keep every lead inside your own WordPress admin, or drop in one hosted script and send leads to your Lead Source dashboard. Same capture either way. The difference is where your data lives.

Free · WordPress.org

The official plugin

  • Captures the source on every Gravity Forms submission, stored in your WordPress admin
  • Two-click install from the directory, no account needed
  • Works alongside your existing Gravity Forms setup, no hidden fields to add
View on WordPress.org
Hosted · any platform

The one-line script

  • One JavaScript line in your <head>, no plugin and no PHP
  • Leads land in your Lead Source dashboard, independent of WordPress
  • Survives a rebuild, host change or full migration
Start free →
The gap

Gravity Forms is a form builder, not an attribution system.

Gravity Forms is the most flexible form builder on WordPress. It stores entries, routes notifications and handles what forms are meant to handle. Attribution was never on the list.

What Gravity Forms captures

The submission itself

  • Name, email, phone, message
  • Every custom field you’ve added
  • Conditional logic, multi-page steps
  • File uploads, payments, signatures
  • Entry timestamp and submitter IP
What it leaves to you

Where that person came from

  • Which campaign brought them
  • Which keyword or ad they clicked
  • The landing page they entered on
  • Which pages they visited before submitting
  • Anything the URL knew, but the form didn’t ask
The usual workaround

Adding hidden fields in Gravity Forms

Dynamic Population looks like the answer. It is the feature everyone points you at, and it does work, as far as it goes. You add hidden fields to each form, map UTM parameters to them, and repeat that for every new form your team builds, then you maintain it through Gravity Forms updates, theme changes and team turnover.

The manual way

  • 01
    Add hidden fields to every Gravity Form: source, medium, campaign, content, term. Five fields per form, minimum.
  • 02
    For each: open Advanced tab, enable “Allow field to be populated dynamically”, set the parameter name to match the UTM key.
  • 03
    Dynamic Population only reads the URL at form load. If a visitor arrives on / with UTMs and navigates to /contact before submitting, the URL is clean. Add a cookie-persistence plugin.
  • 04
    Repeat steps one through three every time someone on the team builds a new form, then keep the cookie-persistence layer working through plugin updates and theme migrations.

With Lead Source

  • Paste one script tag into your WordPress header. That’s the entire install.
  • Lead Source finds every Gravity Form on your site automatically. That includes existing forms, ones your team builds next month, and ones tucked behind popups or embedded on landing pages.
  • Source gets captured at submission, with the campaign name written out (“Google Ads · Local Services Sydney”) rather than left as a raw UTM string like ?utm_source=g&utm_medium=cpc for you to parse.
  • Your forms stay exactly as they are. New Gravity Form built next month? Already tracked, no additional setup needed.

Hidden fields work fine. They just have to exist on every form, be configured the same way each time, and survive whatever else changes around them.

The session problem

Gravity Forms attribution across a session

Dynamic Population reads a parameter from the URL of the page the form is rendered on. On a single-page visit that is plenty. Across a real visit it is not.

Someone arrives on a campaign URL, clicks through to a service page, then submits from there. The parameter was two page loads ago, so the field populates with nothing. Gravity Forms is doing exactly what it says on the tin. The gap is that nothing held the value between the landing page and the form.

Form tracking closes it. The source is recorded on first arrival, held for the whole session, then attached server-side at submission.

Four failure modes

Why Gravity Forms lead tracking arrives empty

Empty entries almost always come down to one of four things.

The session was not held, so the campaign parameters sat on the landing page and nothing carried them forward, or the field exists and nothing writes to it, so every entry arrives empty, which looks like a tracking gap and is a configuration gap, or the value is stored raw rather than resolved, so three spellings of Google become three separate values and no report groups them, or the send action predates the field, so the hidden field is on the form and not in the feed your CRM receives.

That last one catches people out, because the form builder looks correct. Check the feed payload, not the field list, and resolve raw parameters to fixed values, which is what a lead source taxonomy is for.

There is a fifth case, which is that the entry was never a real enquiry. What Gravity Forms ships against that, what the add-ons add and what none of it catches are in Gravity Forms spam.

The hosted option

One script tag. That’s the whole thing.

Prefer not to run a plugin? Sign up, copy the snippet from your dashboard, and paste it into your WordPress header. Gravity Forms then gets detected on every page automatically. The block below shows what the snippet looks like, with placeholder text where your unique site ID will be.

Lead Source installs in a few minutes and leaves your Dynamic Population settings exactly where they are. To measure the gap before you close it, look at the source your forms are capturing today.

example only. Your real code is in the dashboard
<!-- illustrative. Paste your real snippet from app.leadsource.co -->
<script async src="https://app.leadsource.co/ft.js" data-site="YOUR_SITE_KEY"></script>

The real snippet is generated for your account when you sign up. Copy it from the install page in your dashboard. Under 50ms execution. Async, so it doesn’t block your page. No dependencies.

Install on WordPress

Three steps. Most sites are done in five minutes.

1

Sign up and get your script tag

Create your free Lead Source account. The dashboard shows a snippet with your unique site ID already in it. Copy it.

No credit card required to start. The signup flow takes about a minute.
2

Paste it into your WordPress header

Reach for WPCode, Insert Headers and Footers or Header Footer Code Manager, whichever you already run, or edit your theme’s header.php directly if you are comfortable. Position inside the <head> does not matter.

Don’t worry about caching plugins; async scripts don’t need special handling. You don’t need to clear anything.
3

Submit a test through any Gravity Form

Open a page with a Gravity Form on it. Fill it in. Submit. Within a minute or two the lead appears in your Lead Source dashboard with the source, the campaign, and every page visited before submitting.

Want to test attribution end-to-end? Add ?utm_source=test to the URL before you submit. That’ll be the source on the lead.
Common questions

Questions, answered.

Do I need to change my Gravity Forms?

No. Not a single one. Lead Source detects Gravity Forms by listening for the submission event on the page. It never touches your form markup. You don't add hidden fields, you don't edit form settings, you don't install a Gravity Forms add-on.

Can I use the WordPress plugin instead of the script for Gravity Forms?

Yes. The free Lead Source plugin is on the WordPress.org directory. Search Plugins, Add New for "Lead Source", install and activate, and it captures the source on every Gravity Forms submission with every lead stored in your own WordPress admin. The hosted script is the alternative if you would rather keep leads in your Lead Source dashboard, independent of WordPress. Both capture the same thing.

Does it work with AJAX-submitted forms?

Yes, AJAX submission is the standard case. The page doesn't reload, so UTM parameters in the URL stay accessible. We capture them at the moment Gravity Forms fires the submission event. On non-AJAX forms, we capture before the redirect fires.

What about multi-page Gravity Forms with conditional logic?

Works fine. Lead Source captures attribution data the moment the final submission happens. It doesn't care how many steps led there or what conditional rules fired.

Will it conflict with hidden fields I've already set up?

No. Your existing hidden fields keep working exactly as they did. Lead Source runs in parallel. It doesn't write to your form, it doesn't intercept the submission, it just observes. If you're using UTM hidden fields today and they're working, you can leave them in or take them out. Both are fine.

Does it slow my WordPress site down?

The script is under 5KB, loads async, and runs after the page is interactive. Typical execution is under 50ms. It won't move the needle on PageSpeed or Core Web Vitals.

Track your Gravity Forms leads. Free to start.

One script handles every Gravity Form on your site, with source, campaign, and page journey captured on every submission. The first attributed lead arrives in your inbox within minutes of install.

Start free

Free to start · no card