Track UTM Parameters on Your WordPress Forms
You run ads on a couple of platforms, send out a newsletter, and post links on social media. A lead comes in through your contact form. Which one actually brought them in?
Your form doesn’t know. It just knows someone filled it out. If you’ve ever stared at a list of submissions wishing you could tell the Facebook ad from the email blast from the organic search visitor, you’ve run into the same wall a lot of small business owners and marketers hit.
Most guides that promise to fix this assume you already have Google Analytics or Google Tag Manager set up and configured. Plenty of people don’t, and plenty more don’t want to spend an afternoon learning a new platform just to answer one question: which campaign is actually working.
You can track UTM parameters directly inside Ninja Forms, without a separate analytics platform and without asking the person filling out your form to do anything extra.
What you’ll need
To follow the walkthrough below, you’ll need Ninja Forms (free). That’s it for the first method. Further down, there’s a faster, zero-typing version of the same idea that uses the User Analytics add-on (included with memberships or available as a standalone add-on), if you decide you want it.
How to track UTM parameters on your Ninja Forms forms
To track UTM parameters on a Ninja Forms submission, add a Hidden field to your form and set its Default Value to a querystring merge tag that matches the parameter you want to capture, like {querystring:utm_source}. When someone loads your form’s page through a tagged link, Ninja Forms reads that value out of the URL and saves it with the rest of the submission. No add-on, no code, no analytics account required.
One thing has to be true for this to work at all: your campaign links need to actually carry the UTM parameters. A form can only capture what’s in the URL it was loaded from, so a plain link with no tags gives it nothing to grab.
Add a hidden field for each parameter you want to capture
- Open your form in the builder and click into the Form Fields tab.
- Click the blue (+) icon to open the Fields window.
- Add a Hidden field from the picker.
- Click the new field to open its field settings window and find Default Value.
- Enter the querystring merge tag for the parameter you want, for example
{querystring:utm_source}. - Repeat steps 2 through 5 for each parameter you care about. Most people start with
utm_source,utm_medium, andutm_campaign, then addutm_contentorutm_termif they need that level of detail. - Save the form.

Once that’s saved, the field itself stays invisible on the live form. Visitors never see it, never fill it in, and never know it’s there. It just quietly grabs the value from the URL when the page loads.
Fill in the Default Value with the exact merge tag
The syntax is the part people get stuck on, so here’s exactly what that Default Value box should contain for a UTM Source field: {querystring:utm_source}. Swap in utm_medium, utm_campaign, utm_content, or utm_term for the other fields. You’re not writing code here, you’re pasting a specific string into a specific box.

If someone lands on your form without any UTM parameters in the URL, whether it’s a friend clicking a plain link or a visitor typing your address directly, the field just resolves to an empty value. Nothing breaks, and no stray placeholder text like {querystring:utm_source} shows up in your data.
Test it before you trust it
Before you point real campaign traffic at this, run one test yourself. Add a few dummy parameters to your form’s URL, something like ?utm_source=test&utm_medium=test&utm_campaign=test, load the page, and submit the form. Then open Ninja Forms > Submissions for that form and confirm the values showed up alongside the fields your visitor actually filled in.

That test also confirms the fields you added really are invisible to the person filling out the form. Nothing about the visible layout changes, no matter how many hidden fields you’re capturing behind the scenes.

This same mechanic works for more than UTM parameters, by the way. Any value you can pass in a URL, like a coupon code or a referral ID, can be pulled into a form field the same way. UTM tracking is just the most common reason people reach for it.
Give Ninja Forms a try today!
Ninja Forms is free! Optional premium features available with any membership.
Why this works without Google Analytics or GTM
Most UTM tutorials assume you’ve already got Google Analytics or Google Tag Manager running, and they walk you through pulling the parameters out of a dataLayer variable. That’s a reasonable approach if you’re already deep into GA4, but it’s a lot of setup if your only goal is knowing which campaign filled out your form.
The hidden-field method above skips all of that. The data lands directly on the submission record inside WordPress, right where you already check your leads. You don’t need an analytics account connected, you don’t need tracking code installed anywhere else, and you don’t need to cross-reference two different tools to answer one question.
Quick refresher, in case UTM tags are new to you: a UTM tag is just a few extra bits of text added to the end of a link, like ?utm_source=facebook&utm_medium=social&utm_campaign=fall_sale. They don’t change where the link goes. They just ride along so whatever reads them, in this case your form, knows where the visitor came from.
Skip the merge tags with the User Analytics add-on
The hidden-field method is genuinely free and it works, but it does ask you to type exact merge-tag syntax into the right box for every parameter. If you’d rather skip that part entirely, or you want more than just UTM data, that’s what the User Analytics add-on is for.
Instead of typing merge tags into a Default Value box, User Analytics adds a dedicated section to the Fields window called User Analytics Fields. You pick the fields you want from a list, drop them onto your form, and they populate on their own. There’s no Default Value box to fill in at all.
- UTM Source, UTM Medium, UTM Campaign, UTM Content, and UTM Term fields, one for each standard UTM parameter, no syntax required.
- A URL Referer field, which captures the page a visitor was on right before they landed on yours, even when no UTM tag is present at all. This is how you track a referrer on a WordPress form without adding a separate plugin or service.
- Browser, Browser Version, and Operating System fields. These are three separate fields, not one combined field, so add all three if you want the full picture. One heads-up: the Operating System field records the browser’s raw platform value, so expect a technical label like MacIntel rather than a plain Mac.
Every one of these fields stays just as invisible to the person filling out your form as the hidden-field method above. Nobody sees an extra question, nobody has to answer anything they didn’t already come to answer.
One behavior worth knowing before you rely on it: when a submission has no UTM data to capture, such as a direct visit with no campaign link involved, these fields display the text n/a rather than a blank cell. That’s expected, not a bug, and it’s a useful signal on its own: an “n/a” row is telling you that submission came in outside any tagged campaign.
If you’re already using a form to capture additional context about who’s filling it out, this is the same idea applied specifically to marketing attribution: the data arrives with the submission instead of needing you to go dig for it somewhere else. It also pairs naturally with tracking which page someone submitted from, if channel and page-level context both matter to how you follow up on leads.
Pick the method that fits how much setup you want to do
Either way, you can track UTM parameters right on the submission, next to everything else your form collects. The hidden-field method costs nothing and takes a few minutes if you’re comfortable pasting an exact merge tag into a settings box. The User Analytics add-on trades that typing for a handful of ready-made fields, plus referrer, browser, and operating system data the free method can’t reach on its own. Start with whichever matches how much you want to fuss with syntax. And when you’re ready to skip the typing altogether, grab User Analytics and let your forms handle the bookkeeping on their own.
Try Ninja Forms Today
Always free, with premium features available through our memberships.