Skip to content

How to track the source of your leads in Ninja Forms

A Ninja Forms submission normally tells you who got in touch and what they asked for. It rarely tells you what brought them there. This guide shows how to attach channel, campaign, keyword and landing-page data to every submission, so you can compare paid search against organic search or social, and see which content actually produces enquiries. You will also find a field map, a worked example and a checklist for deciding where the data should end up.

What you are building

The setup has three moving parts. A small script on your WordPress site reads signals from each visit, such as UTM parameters, the referring domain and the device used, and sorts the visit into a channel. Hidden fields inside your Ninja Forms receive that information at the moment of submission. Ninja Forms then stores the values next to the lead's name and email, and you choose where to send them.

Nothing about the form's visible fields changes. Visitors still see the same name, email and message inputs; the attribution values travel invisibly alongside them.

Step 1: add the tracking script and the hidden fields

Start by placing the tracking script on your WordPress site; the provider supplies the snippet and publishes WordPress installation instructions. Until that script is live, the hidden fields will exist but stay empty.

Next, open your form in the Ninja Forms builder and drag a Hidden field into it for each value you want to collect. Give each hidden field a default value that matches the name the script expects. The five fields to create are:

  • Channel
  • Channel Drilldown 1
  • Channel Drilldown 2
  • Channel Drilldown 3
  • Channel Drilldown 4

A step-by-step walkthrough for adding hidden fields to Ninja Forms is available from the provider's help centre. Do this on every form that should record attribution, not just your main contact form.

Step 2: how the script fills those fields

Once the script is running, it evaluates each visitor's arrival: UTM parameters in the URL, the referring domain, the device and similar signals. It then assigns the visit to a channel in the same family of categories you would recognise from web analytics, such as Paid Search, Paid Social or Organic Search.

When that visitor submits a form, the script writes the assigned values into the hidden fields. The visitor does nothing differently and sees no extra questions.

Step 3: choose where the source data goes

The values are now stored with the submission, and there are four practical destinations:

  1. Submissions list. Open the Submissions area in your WordPress admin to see the source values beside each lead. This is the quickest way to spot-check that tracking works.
  2. Notification emails. If you answer leads from your inbox and do not run a CRM, add the hidden fields to the lead notification email so the source arrives with the enquiry.
  3. CRM. Ninja Forms ships native integrations with Salesforce, Zoho CRM, Pipedrive and Hubspot. For other systems, an automation tool such as Zapier can carry the values across.
  4. Spreadsheet. The Excel Add-On exports submissions to Excel, or an automation tool can write rows into Google Sheets. From there you can chart the data or connect a reporting tool such as Google Data Studio or Microsoft Power BI.

Pick the destination that matches how you already work. Sending attribution into a system nobody opens adds effort without insight.

Field map: what lands where

Use this map when naming hidden fields and when building reports. The left column is the field you create in Ninja Forms; the right column describes the value the script places in it.

  • Channel — the broad category of the visit, for example Paid Search, Paid Social or Organic Search.
  • Channel Drilldown 1 — the platform or network level, for example Google.
  • Channel Drilldown 2 — the campaign or domain level, for example a campaign name for paid traffic, or the specific Google domain for organic traffic.
  • Channel Drilldown 3 — the most granular level available, for example the keyword bid on or the search term used, where the source exposes it.
  • Channel Drilldown 4 — a further level of detail, available for grouping or segmenting in reports.

Two additional values are captured alongside the channel fields: the initial landing page, such as a specific blog post URL, and the landing page group, such as the /blog section. Those two let you compare sections of your site as well as individual pages.

Worked example: two visitors, one form

Suppose two people complete the same Ninja Forms contact form on the same day.

The first clicked a Google Ads result. Depending on the UTM parameters on that ad, the fields might read: Channel = Paid Search; Channel Drilldown 1 = Google; Channel Drilldown 2 = the campaign name; Channel Drilldown 3 = the keyword bid on.

The second arrived from an unpaid Google search. Their fields might read: Channel = Organic Search; Channel Drilldown 1 = Google; Channel Drilldown 2 = the specific Google domain they came from; Channel Drilldown 3 = the search term, if it is available.

Both submissions look identical in the visible fields. Only the hidden values separate them, which is exactly why the drilldown fields need consistent names and why you should test with a tagged URL before trusting a report.

Three reports worth building first

Once data is flowing, three views answer most early questions.

Leads by channel. A count of leads per channel over time. It gives a high-level picture of where enquiries originate and which channels deserve more investment. If one channel is climbing month over month, that trend is worth investigating before you reallocate budget.

Leads by Google Ads campaign. Leads per month split by campaign. This separates campaigns that produce enquiries from campaigns that produce cheap clicks without conversions, which is the distinction that matters when judging ad spend.

Leads by social network. Leads per month from Organic Social, split by network. It shows which networks your posted content actually converts from, so you can concentrate effort where leads appear.

When source fields come back empty

A form that submits successfully but records blank source values is a different problem from a form that fails to submit. Work through these checks in order:

  • Confirm the tracking script is present on the page where the form lives, not only on the homepage.
  • Confirm every hidden field exists on that specific form and its default value matches the expected field name exactly.
  • Submit a test entry using a URL with clear UTM parameters and inspect the result in the Submissions area.
  • If values appear in Submissions but not in your CRM, the issue is in the integration mapping rather than the tracking setup.

Separating the tracking layer from the delivery layer stops you from debugging the wrong system.

A short pre-launch checklist

Before you rely on this data for budget decisions:

  • The script is installed site-wide on the WordPress site.
  • All five hidden fields exist on every lead-generating form.
  • Field names match the expected values exactly, including capitalisation and spacing.
  • A tagged test submission shows the expected channel and drilldown values.
  • At least one destination (email, CRM or spreadsheet) is receiving the values.
  • Someone has been assigned to review the reports on a regular schedule.

Attribution only pays off when the data reaches a person who acts on it.

Ninja Forms hidden field map
Hidden fieldValue it receivesExample
ChannelBroad marketing channel of the visitPaid Search
Channel Drilldown 1Platform or network levelGoogle
Channel Drilldown 2Campaign name (paid) or specific domain (organic)Brand Campaign / www.google.com
Channel Drilldown 3Keyword bid on or search term used, where availableNinja Forms
Channel Drilldown 4Further detail level for grouping—
Landing pageInitial landing page URLninjaforms.com/blog/best-form-builder
Landing page groupSection of the site the landing page belongs to/blog

Examples reflect the values described for a paid Google Ads visit and an organic Google visit; actual values depend on the UTM parameters applied and what the referring source exposes.

Where to send lead source data
DestinationBest forWhat you need
Submissions sectionQuick review and spot-checkingNothing beyond the form and script
Notification emailsTeams replying from an inbox without a CRMHidden fields added to the notification template
CRMOngoing lead management and reportingA native integration (Salesforce, Zoho CRM, Pipedrive, Hubspot) or an automation tool
SpreadsheetCustom charts and deeper reportingExcel Add-On export or an automation tool writing to Google Sheets

Native integrations listed are those described for Ninja Forms; confirm current availability in your Ninja Forms account before planning around them.

Frequently asked questions

Do visitors see the hidden fields?

No. Hidden fields sit in the form but are not displayed, so the visitor completes the same visible fields as before while the source values are written in the background at submission.

Which UTM parameters affect what gets recorded?

The values written into the drilldown fields depend on the UTM parameters placed behind the link. A tagged ad can supply campaign and keyword detail, while an untagged organic visit is limited to what the referring domain exposes, such as the Google domain and, where available, the search term.

Can I use this without a CRM?

Yes. Add the hidden fields to your lead notification email and the source arrives with each enquiry in your inbox. The Submissions area in WordPress also shows the values beside each lead.

What is the difference between the landing page and the landing page group?

The landing page is the specific URL a visitor first arrived on, such as a single blog post. The landing page group is the section that URL belongs to, such as /blog, which lets you compare whole content areas rather than individual pages.

Why do my source fields show nothing even though the form works?

The most common causes are a missing tracking script on that page, a hidden field that was never added to that particular form, or a field name that does not match the expected value. Test with a tagged URL and check the Submissions area before looking at your CRM integration.