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.
Integrates with the tools you already use.
Works with all Gravity Forms features
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.
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
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
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.
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
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
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
- 01Add hidden fields to every Gravity Form: source, medium, campaign, content, term. Five fields per form, minimum.
- 02For each: open Advanced tab, enable “Allow field to be populated dynamically”, set the parameter name to match the UTM key.
- 03Dynamic Population only reads the URL at form load. If a visitor arrives on
/with UTMs and navigates to/contactbefore submitting, the URL is clean. Add a cookie-persistence plugin. - 04Repeat 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=cpcfor 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.
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.
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.
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.
<!-- 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.
Three steps. Most sites are done in five minutes.
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.
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.
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.
?utm_source=test to the URL before you submit. That’ll be the source on the lead.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 freeFree to start · no card











