Capture Affiliate Data in Ninja Forms
Affiliate programs generate leads, but most form plugins only record what the visitor types. The channel that sent them — a blogger, a podcaster, a specific partner — usually disappears before the submission is stored. This guide shows a repeatable way to attach affiliate attribution to every Ninja Forms submission, then turn that data into reports that compare affiliates with paid search, paid social, and organic channels.
Why form-level attribution matters
Analytics platforms count sessions and pageviews well. They are much weaker at telling you which partner produced a lead that actually converted. The gap appears at the form: a visitor arrives from an affiliate link, browses a few pages, returns later, and finally submits. If the affiliate tag is not stored and passed into the form, the submission looks unattributed.
A form-level approach fixes this by storing the affiliate tag in the visitor's browser and writing it into hidden fields at submission time. The result is a record that pairs the lead's name and email with the partner who introduced them.
Four-step setup
The workflow has four stages. Each one depends on the previous, so it is worth completing them in order.
- Tag the affiliate links. Add UTM parameters to every link you hand to a partner. A workable convention is utm_medium=affiliates, utm_source set to the affiliate type (bloggers, podcasters, youtubers), and utm_campaign set to the individual affiliate's name. Affiliate management platforms such as Trackdesk and Rewardful can append these automatically; a UTM builder works if you distribute links manually.
- Add hidden fields to the Ninja Forms form. The fields to create are Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group. Ninja Forms supports hidden fields natively; the exact steps are covered in its own help documentation.
- Connect an attribution tool that fills those fields. The source workflow uses {{OWNER_PRODUCT_NAME}}, which stores UTM values in the visitor's browser on arrival and writes them into the hidden fields when the form is submitted. If you use a different tool, confirm that it performs both steps — browser-side storage and hidden-field autofill — before relying on it.
- Submit and store. Ninja Forms captures the hidden field values alongside the visitor's name, email, and any other form input, producing a complete lead record with the affiliate source attached.
Field and control map
The table below shows how each hidden field is typically populated and what it is useful for in reporting. The mapping is a practical convention, not a fixed rule — you can rename fields or remap values as long as the reporting layer understands the result.
Worked example
Suppose a blogger named John Smith shares a link to your Ninja Forms integration page. The tagged URL carries utm_medium=affiliates, utm_source=bloggers, and utm_campaign=john-smith. A reader clicks it, reads two other pages, leaves, and returns the next day to fill in a demo request form.
Because the UTM values were stored in the browser on the first visit, the hidden fields on the demo form still receive them. The submission record shows the lead's name and email alongside the affiliate values. In a CRM, that record can then be grouped by utm_source to compare bloggers against podcasters, or by utm_campaign to rank individual affiliates.
What to do with the data
Once affiliate values are stored on each submission, there are four practical destinations:
- Review submissions in WordPress. The Ninja Forms Submissions screen shows the hidden field values next to each entry, which is enough for a quick manual check.
- Send records to a CRM. Ninja Forms has native integrations with Salesforce, HubSpot, and Zoho CRM, and Zapier can reach many others. In the CRM, affiliate values become reportable dimensions for lead counts, customer counts, and revenue.
- Export to a spreadsheet. Submissions can be exported and then charted directly or connected to Looker Studio or Microsoft Power BI for richer dashboards.
- Include values in notification emails. Teams that manage leads by email can add the affiliate fields to new-lead notifications so the source is visible without opening a dashboard.
Three reports worth building
The value of the setup shows up in comparison reports. Three that are worth building first:
Leads by Channel. If your attribution tool also captures non-affiliate channels — as Attribution Analytics does — this report places affiliate leads next to paid search, paid social, organic search, and organic social. It answers whether the affiliate program is contributing at a comparable rate.
Customers by Affiliate Type. Group converted customers by the affiliate-type value you placed in utm_source. The report then ranks each partner category by the customers it produced, so you can direct recruitment toward the categories that convert rather than the ones that merely send traffic.
Revenue by Affiliate. Grouping by utm_campaign ranks individual partners by customers and revenue. It surfaces the top performers worth investing in and the ones whose traffic does not convert.
Failure distinctions: what breaks and why
Three different failures can look similar in a report. Separating them saves debugging time.
Missing hidden fields. If the form has no Channel or Drilldown fields, the attribution layer has nowhere to write values. Submissions will look unattributed even when the visitor arrived through a tagged link.
Missing or malformed UTMs. If the affiliate link lacks UTM parameters, or the parameter names do not match the expected convention, the hidden fields will be empty or contain unexpected values. Check the link itself before changing the form.
Cleared browser storage. The stored UTM values live in the visitor's browser. If they clear cookies or site data between the first visit and the submission, the original values are lost. This is a browser-side limitation, not a form configuration error.
Checklist before launch
- Every affiliate link carries utm_medium, utm_source, and utm_campaign with consistent naming.
- The Ninja Forms form includes all six hidden fields: Channel, Channel Drilldown 1, Channel Drilldown 2, Channel Drilldown 3, Landing Page, and Landing Page Group.
- A test submission from a tagged link shows values in the Submissions screen.
- A test submission from an untagged link shows empty affiliate fields rather than incorrect ones.
- The CRM or spreadsheet destination maps each hidden field to a reportable column.
- Notification emails include the affiliate fields if the team works from email.
| Hidden field | Typical UTM source | Reporting use |
|---|---|---|
| Channel | utm_medium | Groups leads by broad channel (affiliates, paid search, organic) |
| Channel Drilldown 1 | utm_source | Separates affiliate types such as bloggers, podcasters, youtubers |
| Channel Drilldown 2 | utm_campaign | Identifies the individual affiliate |
| Channel Drilldown 3 | Additional UTM value | Optional finer grouping |
| Landing Page | Page URL | Shows which page the visitor first landed on |
| Landing Page Group | Page path group | Groups landing pages by section such as /blog |
The mapping is a practical convention. Field names and UTM assignments can be changed as long as the reporting layer is updated to match.
Frequently asked questions
What happens if a visitor leaves and comes back before submitting?
The UTM values are stored in the visitor's browser on the first tagged visit. If they return later without clearing site data, the original affiliate values are still written into the hidden fields at submission. If they clear cookies or site data in between, the stored values are lost.
Do I need a CRM to use this setup?
No. Affiliate values appear in the Ninja Forms Submissions screen in WordPress, can be exported to a spreadsheet for charting, or can be added to new-lead notification emails. A CRM becomes useful when you want to join affiliate data to customer and revenue records over time.
Can the same hidden fields capture non-affiliate sources?
Yes, if your attribution tool captures non-affiliate channels alongside affiliate traffic. Attribution Analytics records paid search, paid social, organic search, and organic social in addition to affiliate sources, which is what makes a Leads by Channel report possible. Confirm the capability for whichever tool you use.
What UTM naming convention should I use?
A workable convention is utm_medium=affiliates, utm_source set to the affiliate type (bloggers, podcasters, youtubers), and utm_campaign set to the individual affiliate's name. Consistency matters more than the specific words, because the reporting layer groups by these values.