Set up Ninja Forms to capture UTM parameters and marketing attribution

Add Madlitics fields to a new or existing Ninja Form to capture original channel, campaign and landing page data alongside each lead.
Attribution is broken

Madlitics keeps the original marketing source attached to your Ninja Forms leads. It captures first-touch attribution when someone arrives on your website, preserves it as they browse, and writes the available channel, campaign and landing page data into hidden fields when they submit.

Ninja Forms can populate hidden fields from parameters in the current URL. Madlitics carries the original attribution beyond that landing page and identifies untagged sources using available referrer information, giving you useful context beyond campaign UTMs.

This guide shows you how to configure the fields in a new or existing form, add the form to your website, and find the captured data in your submissions. You can then map those fields through your existing connections so attribution stays with the lead in your CRM and other tools.

‍

‍

Before configuring your form, make sure Madlitics is installed on your WordPress website. The script captures and preserves attribution, while the hidden fields receive that data with the submission.

Activate the Ninja Forms plugin

Step 1: Get started by installing the Ninja Forms plugin to your WordPress environment. Select Plugins from the sidebar menu and either click the 'Add Plugin' button from the page or select the 'Add plugin' dropdown menu item. Search for 'Ninja Forms' via the Search Plugins textfield input. Once the plugin has been found, install it. Once installed the plugin must be activated by clicking the 'Activate' button.

Plugins > Add Plugin > Search 'Ninja Forms' > Install > Activate

Plugins > Add plugin > Search for 'Ninja Forms' > Click 'Install'

‍

Click 'Activate' to enable Ninja Forms.

‍

‍

Use a new or an existing lead form

Step 2: Navigate to Ninja Forms from your sidebar menu in WordPress. Create a new form via the Dashboard screen by clicking the "Add New" button (also accessible via the "Add New" submenu option under dashboard). Select the type of form you would like to use to capture attribution data.

Working with a previously created form? Select your form, then click the settings gear(⚙️) > 'Edit' to open the form editor.

Add new > Select form template

Create a new form by clicking the 'Add New' button.
‍
Select a type of form.

Configure fields for attribution

Step 3: Add seven hidden fields to receive the attribution Madlitics captures. These fields keep the original channel, campaign details and landing page alongside the lead’s answers without adding additional fields to complete.

Add the first Hidden field and open its settings. Set the Field Label to channel and the Default Value to [channel]. Repeat this process using the remaining labels and default values below, then save and publish the form.
‍

Create forms that fit your process, with any fields you choose.

‍

Place a hidden field in your form to store attribution data from Madlitics.

‍

Define the 'Field Label' as channel and the 'Default Value' as [channel] based on the Madlitic Fields' settings above.

‍

Repeat this process for the 6 remaining Madlitics fields, and save the form to begin collecting customer lead data.

‍

Publish the form to make it active.

‍

Default Madlitics fields and values

Marketing Channel Category
Records the original marketing channel, such as Paid Search, Organic Search, Organic Social, Email or Referral, based on the available attribution signals.
Label: channel
Default value: [channel] 

Segment 1

Records the original source. For UTM-tagged campaigns, this is the value supplied in utm_source.
Label: segment1
Default value: [segment1]

Segment 2
 
Records the original campaign details. For UTM-tagged campaigns, this is the value supplied in utm_campaign.
Label: segment2
Default value: [segment2]

Segment 3

Records the value supplied in utm_term for tagged campaigns. This might contain a keyword, ad group or another detail defined by your tagging approach.
Label: segment3
Default value: [segment3]  

Segment 4
Records the value supplied in utm_content for tagged campaigns, such as an ad variation, creative name or content identifier.
‍
Label: segment4
Default value: [segment4]

Landing Page
Records the original page where the lead first arrived, even when they submit a form on another page.
‍
Label: lp
Default value: [lp]

Landing Page Group
Records the original landing page group so related entry pages can be compared together in your reports.
‍
Label: lpg
Default value: [lpg]

‍

The campaign segment examples above describe UTM-tagged traffic. Untagged visits use the source information available to Madlitics; campaign values that were never supplied cannot be recovered.

Configure additional Madlitics field value pairs for deeper customization and richer insights. For campaign-tagging examples and how the values carry into submissions, see the Ninja Forms UTM tracking guide.

Embed the Ninja Form

Step 4: Open the WordPress page or post where you want the form to appear. Add a Ninja Forms block, then choose the form you configured with the Madlitics fields.

Save your changes and publish when ready. You can use the configured form on other pages or repeat the field setup for additional forms.

‍

Select 'Add Block' > Search for Ninja Forms > Select Ninja Forms block

‍

Select the name of the form and publish.

‍

Select the form and 'save draft' or publish when complete.

Which UTM parameters are captured in Ninja Forms?

Madlitics organizes tagged campaign data into four standard segment fields and records the value in its corresponding parameter.
UTM parameter
Madlitics field
Example value
utm_source
segment1
google
utm_campaign
segment2
demand_gen_q1
utm_term
segment3
marketing_teams
utm_content
segment4
video_a

The marketing channel is stored in channel and is a classification of utm_medium alongside other available signals. The lp and lpg fields capture the original landing page and its group separately from the campaign parameters.  What you record in utm_term and utm_content depends on your tagging plan.

View captured attribution in Ninja Forms

When a lead submits the configured form, Madlitics records their available original channel, campaign segments and landing page data alongside their answers. Open the entry in Ninja Forms submissions to see the attribution attached to that lead.

A lead who arrives through a tagged campaign and browses to your contact page can still submit with the original campaign and landing page recorded. Map the captured fields through your existing Ninja Forms connection to keep that context available in your CRM, email platform or reporting tools.

Original channel, campaign and landing page data appear alongside the lead’s answers in Ninja Forms submissions.
Stacked bar chart showing lead generation by marketing channel over time, comparing sources like Paid Search, Paid Social, Organic Search, Direct, and Email. Helps visualize which channels drive the most traffic.
Line chart displaying lead-to-customer conversion rates by channel, comparing Google Ads, Facebook Ads, LinkedIn Ads, Organic Search, and Email. Shows how different sources drive qualified leads over time.
Line chart showing revenue performance by marketing campaign, comparing Google Ads, Facebook Ads, and LinkedIn Ads. Helps identify top-performing and underperforming campaigns.

Related articles

Your Ninja Forms submissions can now carry the marketing context behind each lead. With attribution fields mapped into your connected tools, you can compare original sources and campaigns alongside lead quality, pipeline stages and customer outcomes.

Frequently asked questions

Answers to common questions about setting up tracking with Madlitics and Ninja Forms