How to track the source of your leads in Ninja Forms.
Ninja Forms runs every submission through a chain of Actions. Recording the campaign that sent the visitor is the one nobody switched on.
Works with all Ninja Forms features
Two ways to run it on Ninja Forms.
The plugin keeps the source in wp-admin, next to the submissions your Store Submission Action already saves. The hosted script files leads in your Lead Source dashboard, off the WordPress box entirely. Either way the Action chain is left alone.
The official plugin
- Adds the source to each Ninja Forms submission, kept in wp-admin
- Two-click install from the directory, no account needed
- Runs alongside your existing Action chain, no Action to build
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
Ninja Forms is a pipeline of Actions. Source was never one of them.
Ninja Forms is built around Actions. Every submission flows through the ones you have switched on. Email, store submission, redirect, and whatever Add-ons you have bought. There is no Action that records which campaign, ad or post sent the visitor, and the marketing Add-ons that come close still leave the hard part with you.
Everything after the submit
- Email notifications and auto-responders
- Store Submission, so entries live in wp-admin
- Redirects, success messages, webhooks
- Multi-part steps, conditional logic, calculations
Which click started it
- The campaign that sent them, as a readable name
- Source held across the visit, not read once at submit
- Every page they opened before reaching it
- The same source format on the quote form as the contact form
Adding hidden fields in Ninja Forms
The standard fix is one Hidden field per UTM, a default value pulled from the query string, and a merge tag dropped into the Email Action. The field looks at the URL once, as the form renders. A visitor who clicked around first has already shed the parameters.
The manual way
- 01Drag a Hidden field onto each form for every UTM key and point its default value at the query string.
- 02Map each hidden field into your Email Action with its merge tag, or the values never reach your inbox.
- 03The default value is set when the form renders, from that page's URL. Second pageview, no UTMs, so bolt on a cookie script to remember them.
- 04Do it all again on the next form, then check the merge tags still resolve after each Ninja Forms release.
With Lead Source
- Install it once, as the plugin or the script, and every Ninja Forms form reports a source without an Action of its own.
- The referrer and UTMs are picked up on the first page and carried through the visit, ready when Ninja Forms reports a successful submit.
- The lead shows a readable campaign name where a merge tag would have pasted utm_campaign exactly as typed.
- Build a new form next month and it is tracked before you publish it. Nothing to map into an Action.
The Action model is what makes Ninja Forms flexible. Catching the source before the visitor reaches the form is the one job it leaves outside the chain.
Holding the lead source across a session
A Hidden field with a query-string default only ever sees the URL of the page the form is on. That single limit decides whether your source column is full or empty.
Your best Ninja Forms lead probably clicked an ad, read the landing page, opened two more, then filled in the form. The campaign parameters were on page one. The form was on page four, where the URL had none, so the Email Action sent a blank.
Form tracking reads the referrer and UTMs on page one and keeps them for the session, so page four still knows.
Why the Ninja Forms lead source is blank
When the source merge tag prints nothing, check four things, starting with the Actions.
The usual culprit on Ninja Forms: the Hidden field was added after the Email Action was built, and adding a field does not add it to an Action that already exists, so the value is on the form and missing from the email. Next, the UTMs stayed on the landing page and the form page had none to give. Then the field with no default value set, which writes nothing on every submit. Last, raw values, where google and Google get counted as two different sources.
Open the Action before the field list. Then map raw values to a fixed lead source taxonomy so next year's numbers still add up to this year's.
One script tag. That’s the whole thing.
Would rather keep the plugin list short? Make an account, copy the tag from the dashboard and add it to the site header. Every Ninja Forms form is picked up from there, multi-part ones and AJAX submits too. Here is its general shape, with a placeholder for your site key.
Lead source tracking installs in a few minutes and never appears in your Actions list. Worth looking at the source your forms are capturing today before you touch a single Action.
<!-- 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.
Pick your path
Choose the free plugin on WordPress.org, or the hosted tag in your dashboard. Whichever you pick, every Ninja Forms form on the site is in.
Activate, or paste the snippet
Plugin: press Activate and step through the setup wizard. Script: put it in the site <head> via WPCode, Insert Headers and Footers, or a theme header setting.
Submit a test through any Ninja Forms form
Send a submission through one of your Ninja Forms. It reaches Lead Source a minute or two later, channel, campaign and page path attached, while the Email Action does its usual job.
?utm_source=test to the URL before you submit. That’ll be the source on the lead.Questions, answered.
Do I use the plugin or the script for Ninja Forms?
Use the plugin if you want each source kept in wp-admin beside your Ninja Forms submissions, with no account to create. Use the hosted script if you want leads kept by Lead Source, away from the WordPress database. What gets captured is the same in both.
Is there an official Ninja Forms plugin on WordPress.org?
Yes. Lead Source is a free plugin on WordPress.org. From wp-admin open Plugins, Add New, search "Lead Source", then install and activate. Ninja Forms submissions carry their source from there, with no Action to build and no Add-on to buy.
Do I need to add a new Action to my Ninja Forms?
No. Lead Source listens for the Ninja Forms submission event in the browser rather than running inside your Action chain. Your Email, Store Submission, and redirect Actions keep working unchanged, and the source is recorded alongside them.
Does it work with multi-part Ninja Forms and conditional logic?
Yes. The source is attached when the last part is submitted, so a long multi-part form and a single-page one are handled the same, whichever conditional rules fired along the way.
Will it conflict with my Ninja Forms Add-ons or integrations?
No. Lead Source watches the submit and leaves it untouched, so your CRM, email marketing and webhook Add-ons fire exactly as set up. The source is logged next to them.
Track your Ninja Forms leads. Free to start.
Channel, UTMs and page path on every Ninja Forms submission, from the free plugin or one script. Nothing added to the Action chain, and the first lead can arrive within minutes.
Start freeFree to start · no card











