How to Track UTM Parameters in Ninja Forms

See which campaign sent each Ninja Forms lead. Add one script tag, no hidden fields, then test with a UTM link.

Author
SourceTrack Team
Read Time
05 Mins read
Published Date
How to Track UTM Parameters in Ninja Forms

Ninja Forms collects the lead. SourceTrack tells you where the lead came from. This guide shows how to set that up. You add one script tag, and each Ninja Forms lead is linked to its source.

Step 1: Add the script tag

Copy your one script tag from SourceTrack. Paste it into the head of your website, once. The install guide shows where it goes. On WordPress, see the WordPress guide.

Step 2: Put your Ninja Forms form on a page

Show your Ninja Forms form on a page of your site as you normally do. SourceTrack captures a Ninja Forms form that sits directly on your page. Do not add any hidden fields.

Open your page with UTMs on the end of the link, like this:

https://yourwebsite.com/contact?utm_source=test&utm_medium=email&utm_campaign=form_test

Open it in a new private window. If your browser sends Do Not Track or Global Privacy Control, SourceTrack respects that and will not track the visit. Fill in the form and send it.

Step 4: Look at the lead in SourceTrack

Open SourceTrack and find the new lead. Check that the source, medium and campaign match your test link.

How Ninja Forms handles UTM parameters on its own

Ninja Forms can read the link too. In its guide to auto-populating form fields using a query string, you add a Hidden field and set its Default Value to a querystring merge tag, such as {querystring:source} for a link ending in ?source=facebook. The Ninja Forms hidden field article confirms the Default Value supports merge tags. For UTMs you repeat this for each tag.

The weak points are the same ones that hit every hidden field:

  • Page caching. Neither page describes caching. If your page is cached, the stored value can be stale, so test with a fresh tagged link.
  • The visitor moves to another page. The merge tag reads the link of the page that loads the form. A visitor who lands on a blog post from an ad and then opens your contact page arrives with no tags.
  • First touch against last touch. A hidden field holds one value, so it cannot show both the first and last source.
  • Multi-step forms. Check the vendor documentation for how values carry across the steps of your form. We did not find it covered.

What you will see

Your test lead shows the source test, the medium email and the campaign form_test. You also see the page the visitor landed on. If you see these, Ninja Forms is tracking UTMs for you.

What SourceTrack records for each Ninja Forms lead

When someone sends a Ninja Forms form on a page that has the script, the lead is linked to the visit that brought them. For each lead you can see:

  • UTM parameters: utm_source, utm_medium, utm_campaign, utm_content and utm_term.
  • Ad click IDs: gclid for Google Ads, fbclid for Meta Ads, msclkid for Bing Ads and li_fat_id for LinkedIn Ads.
  • Referrer and landing page: the site that sent the visitor and the first page they viewed.
  • First touch and last touch: both appear in the lead’s touchpoint timeline, so you can compare what started the journey with what closed it.
  • AI assistant referral: when the visit came from ChatGPT, Claude, Perplexity or Gemini, the lead shows which assistant it was.

The form name and the page address are saved with the lead as well. All of this comes from the visit, not from the form, so none of it needs a field in Ninja Forms.

Common problems and fixes

Most missing leads come down to a short list of causes. Work through them in order.

  • Nothing shows up at all. View the page source and check that the script tag sits inside the <head>. Then open your browser’s developer tools, choose Network, filter by track and reload. A successful request means the script is running. The install guide shows where the tag goes, and the WordPress guide covers header plugins.
  • Do Not Track or Global Privacy Control is on. SourceTrack respects both. If your browser or an extension sends either signal, the tracker does not run, and your test visit will not appear. Test in a browser without them, or turn the setting off for the test.
  • Caching or minify. After you paste the tag, clear your site cache. If a cache plugin bundles JavaScript, exclude tracker.min.js from minification and defer lists, then look for errors in the browser console.
  • The form is inside an iframe. A form in an iframe submits in its own frame, which the page script does not see. SourceTrack captures forms that sit directly on your page.
  • The test looks wrong. Open your tagged link in a new private window, not a tab you used before, and open it directly rather than clicking through from another page on your site. The link needs the tags the first time the visitor arrives.
  • Everything shows as Direct. The visit had no tags and no referring site. Tag the links you control. The troubleshooting guide explains why a visit can arrive without a referrer.

Further reading

Frequently asked questions

Do I need hidden fields in Ninja Forms?

No. Once the script is on your site, SourceTrack captures Ninja Forms forms that sit on your page. You do not change the form.

SourceTrack still looks at where they came from, such as a search engine or another website. If the link has no tags and the visit has no referring site, it shows as Direct. So tag the links you control, like emails, ads and social posts.

Does SourceTrack set cookies?

SourceTrack sets no third-party cookies and does no cross-site tracking. Cookieless Mode, a setting on every plan, goes further and sets no cookies at all. It also respects Do Not Track and Global Privacy Control.

What if the visitor browses other pages before they reach the Ninja Forms form?

The lead is still linked to the visit that brought them to your site, because SourceTrack reads the visit and not the page the form is on. The lead shows the first touch and the last touch, so the original ad or email is not lost when someone clicks from a landing page to your contact page.

Why did my test lead not show up?

First, check that the script tag is on the page with the form. Second, try a private window that does not send Do Not Track or Global Privacy Control, because SourceTrack respects both. Then see the troubleshooting guide.

Next step

Tag the links you share, then watch the leads come in. Learn the basics in how to track UTM parameters, read the install guide or the troubleshooting guide, or see how every tool connects.

Related Blogs

How to Track UTM Parameters: The Basics

Learn what UTM parameters are, how to build tagged links, and how to see which campaign sent each lead. Plain steps, no code.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026

How to Track UTM Parameters in Cal.com

See which campaign sent each Cal.com booking. Add one script tag to the page with your embed, then test with a UTM link.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026

How to Track UTM Parameters in Calendly

See which campaign sent each Calendly booking. Add one script tag to the page with your embed, then test with a UTM link.

SourceTrack Team

Attribution & Growth Engineering

20 Oct, 2026