To capture UTM parameters in Ninja Forms, add Hidden fields and set their default values to querystring merge tags such as {querystring:utm_source}. This reads the form page's URL. If visitors reach another page before submitting, you also need a method that keeps the campaign values and fills the form from that saved data.
Keep the campaign with the enquiry
A campaign can bring plenty of form submissions without bringing suitable customers. To track lead source through to those outcomes, keep the source with each enquiry and record qualification and sales in a CRM or spreadsheet.
TrackLeadSource collects available source, medium and campaign information, together with the recorded source journey and pages visited. Its workflow passes that context through hidden form fields with the enquiry. The native Ninja Forms steps below describe URL capture; they do not establish a tested TrackLeadSource installation for Ninja Forms.
For example, imagine someone arrives through a Google ad, reads a service page, then returns through a newsletter before requesting a quote. The recorded visits and pages can help explain that enquiry. Once the team saves the sales outcome against the same lead, it can compare which campaigns bring suitable customers. A page visit alone doesn't establish buying intent or credit for a sale.
Add fields for the values you need
The official Ninja Forms walkthrough describes a method using the free plugin. You need permission to edit the form and inspect submissions in WordPress.
Open the form's Form Fields tab, use the plus button and add a Hidden field. Give it a recognisable label, then enter the matching merge tag in Default Value. Repeat for the campaign values you want to save.
| Field label | Default Value |
|---|---|
| UTM Source | {querystring:utm_source} |
| UTM Medium | {querystring:utm_medium} |
| UTM Campaign | {querystring:utm_campaign} |
These labels are examples for your own form. They are not prescribed TrackLeadSource field names. Ninja Forms explains the merge-tag syntax in its querystring documentation.
Save the form. For a direct form-page test, adapt this illustrative URL to your site:
https://example.com/contact/?utm_source=newsletter&utm_medium=email&utm_campaign=autumn_quote
Submit a test enquiry and look for newsletter, email and autumn_quote in the saved submission. Those are expected values for this example, not the results of a test performed for this article.
Keep values when the visitor browses
A visitor might enter on /services/ with the campaign parameters, follow a link to /coverage/, then open /contact/ without them. A querystring default on the contact form has no earlier URL to read.
The capture method needs to run on the landing page, keep the values through that navigation, and fill the hidden fields before submission. Decide whether the saved campaign represents the first recorded visit or a later campaign visit. Use separate fields if you need both; otherwise a later visit can change the meaning of your reporting.
Ninja Forms also offers the User Analytics add-on. Its dedicated analytics fields reduce manual merge-tag setup and can store source context alongside submissions. It is a separate add-on that must be installed and activated. Automatic field population does not establish that earlier campaign data survives navigation. Verify that behaviour before choosing it for this particular requirement.
For a broader explanation of capture and retention, see the guide to keeping lead source data with website forms. A persistence tool or custom implementation still needs to be checked with your Ninja Forms submission flow.
TrackLeadSource
See the story behind each lead.
Keep source, campaign, and journey context together when a visitor becomes a lead.
14-day free trial. Cancel anytime
Test the route your visitor takes
Use a recognisable campaign value that you can find in the saved record. Complete two separate checks:
- Open the tagged form page directly, submit and inspect the entry under
Ninja Forms > Submissions. - Open a tagged landing page, browse to another page and reach the form without the original querystring. Submit again and compare the saved values with the landing-page values.
The second check establishes whether your retention method works through navigation. A successful first check establishes URL capture on the form page.
Repeat with an untagged visit and another campaign to check your overwrite rules. Run the public form while logged out, under the caching and consent conditions visitors encounter. Record what was saved rather than treating a successful submission message as proof of campaign capture.
If a direct tagged submission saves empty values, check the parameter spelling, the field's default value and the final URL after redirects. If direct capture works but the navigation test fails, check the method that keeps and repopulates the values. Ninja Forms' User Analytics documentation also flags caching as a possible cause of missing UTM values; ask your host to diagnose the affected route before changing cache rules.
Check the destination record
When your form already sends enquiries to a CRM, map the source fields through that connection and inspect the resulting lead or contact. A saved WordPress entry and a saved CRM record are separate checks. Compare the same test enquiry in both places.
Keep source, medium and campaign distinct. In the example above, newsletter identifies the source, email describes the medium and autumn_quote identifies the campaign. Add qualification and sales outcomes to that record when they become known. The CRM lead source guide explains how to keep these meanings consistent.
For untagged visits, a referrer may add useful context, but it doesn't settle every paid-versus-organic distinction. Google can send paid search and organic search visitors. Use campaign tagging where you control the links, and leave missing evidence visible in your reports.
Common questions
The documented hidden-field method reads query parameters into the submission without a Google Analytics account. Analytics reports can answer other questions about visits; check the saved form entry to confirm which values accompanied an enquiry.
Ninja Forms' documentation describes n/a for unavailable User Analytics data. Inspect the tagged URL and field setup, then investigate caching if the values should have been present. Treat an unavailable value as missing evidence; it doesn't prove an organic or direct source.
The querystring method accepts a matching parameter key in the merge tag. Add a field only when you have a use for that value, and check the saved result. This native Ninja Forms feature does not establish which parameters TrackLeadSource collects.
Helping marketers connect website form submissions to their source, campaign, and customer journey.


