Support

Setting up Contact Form 7 for Marketing Attribution and UTM Tracking

Step-by-step setup to add Madlitics fields to Contact Form 7 so every response includes channel, campaign, and landing page attribution.
Start capturing attribution →
Attribution is broken
Automation icon indicating hands-free marketing attribution and data flow.
Analytics report icon, indicating data insights and reporting.
Impact measurement icon, symbolizing marketing effectiveness.
Personalization icon, representing customization features.

Contact Form 7 is one of the most popular and lightweight WordPress form plugins, trusted by marketers and website owners for its simplicity and flexibility. It’s an ideal solution for teams that want reliable lead capture without unnecessary complexity. With its straightforward form setup, you can create conversion-focused contact and lead forms that integrate seamlessly with Madlitics. By adding Madlitics fields, every submission is enriched with valuable attribution data such as channel, campaign, and landing page, so you can clearly see which marketing efforts are generating real results.

In this guide, we’ll show you how to install Madlitics, set up Contact Form 7, and configure your forms to capture and submit attribution data, including UTM parameters, alongside your lead and customer information.

💆 Heads-up: Make sure Madlitics is installed on the site where this Contact Form 7 lives (ie. Wordpress). The form alone won’t capture attribution data — Madlitics needs to be running on the page to pass lead data into your submissions.

Installing Madlitics on Wordpress -> 

1. Install and activate the Contact Form 7 plugin

Get started by installing the NinjaForms 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 'NinjaForms' 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 'Contact Form 7' > Install > Activate

Plugins > Add plugin > Search 'Contact form 7' > Click 'Install Now'

Click 'Activate' to enable Contact Form 7

2. Create a form to capture attribution data

Navigate to Contact menu item (from the sidebar menu) in Wordpress. Create a new form by clicking the 'Add Contact Form' via the Contact Form 7 submenu (also accessible via the 'Add Contact Form' button  on the Contact Form 7 main page).

Working with a previously created form? Navigate to your form and click 'Edit' to open the form editor.


Navigate to 'Contact' > Click 'Add Contact Form'

3. Add Madlitics' Fields

Copy and paste the code block below to add hidden fields to your Contact Form 7 form. Place the hidden fields just above the ‘Submit’ button. These fields should not appear in your form preview. If you see them, re-paste the code and save the form again.

Note: Contact Form 7’s editor can be finicky. Make sure your form is fully set up before adding the hidden fields, then save right away. Additional edits after adding the hidden fields may cause them to show in the preview. Saving may convert the html numeric codes [, ] to characters [, ], this is perfectly normal.

💡 Configure additional Madlitics field value pairs for deeper customization and richer insights.

Use the form field code snippet below, just above the submit button. This is specific to Contact Form 7.

[hidden channel "[channel]"]
[hidden segment1 "[segment1]"]
[hidden segment2 "[segment2]"]
[hidden segment3 "[segment3]"]
[hidden segment4 "[segment4]"]
[hidden lp "[lp]"]
[hidden lpg "[lpg]"]

Contact Form 7 'New Form' (Default view)
Copy and paste the Madlitics form field code at the bottom of the form, above the 'Submit' button

Saving may convert the html numeric codes [, ] to characters [, ], this is perfectly normal

4. Add the form to a page (or post)

Select the page (or post) you want to begin capturing marketing data on, with the newly created form. In the page editor, select 'Add Block', search for Contact Form 7 and click the Contact Form 7 block component. Select the the name of the form, that includes the hidden fields, from the Select Form dropdown to embed it on the page.

Repeat the steps in this installation guide, on any number of pages, posts and forms across your site to capture marketing attribution data with Contact Forms 7 — any way you need.

Add block > Search 'Contact Form 7' > Select Contact Form 7

Select the form and preview or publish page/post when your done.

5. Test and publish

Once your form is ready, hit Preview to make sure everything looks good. If something seems off (like fields showing that should be hidden), don’t worry — it happens. Code input can be finicky and sometimes things don’t save the first time. Just copy the field snippet back in, save again, and refresh the preview.

When it looks right, go ahead and Publish your page. From there, you’re ready to test by submitting a form and confirming data flows through as expected.

Preview the post for review, publish to test

⚠️ Are our form fields showing? They shouldn't be...
Copy and paste the form field code snippet again, immediately save the form.

Form fields should not display when the form is previewed or published
Madlitics multi-channel attribution visualization, showing marketing platforms like TikTok, Instagram, Google, and Facebook. The graphic highlights how different sources contribute to high-performing marketing channels.
Screenshot of a form builder interface with a highlighted 'Hidden Input' field. Accompanied by text explaining how to install and set up Madlitics by adding hidden fields to capture marketing attribution data.
CRM interface showing a detailed view of captured attribution data, including marketing channels, segments, and landing pages. A business profile of a lead is displayed, highlighting how Madlitics enriches lead data for sales and marketing teams.
Graph showing new customer growth from TikTok, Instagram, Snapchat, and Google over time, with social media icons surrounding the chart and a callout for social revenue impact.
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.
Stacked bar chart illustrating lead volume across different marketing campaigns, including Black Friday, Retargeted, Spring Promo, Referral, and SEO. Highlights trends in campaign effectiveness.
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.

With Madlitics now activated and your forms ready to accept marketing attribution data, you can start tracking valuable insights immediately, and pass attribution data into your CRM, email marketing platform, business intelligence tool or more for advanced reporting.

Related articles to get you started with Madlitics

Frequently Asked Questions

Answers to common questions about setting up tracking with Madlitics and Contact Form 7

Everything you need for reliable lead attribution
Accurate, persistent, and automated tracking — so your campaigns perform at their best.
Performance icon symbolizing marketing campaign effectiveness and results tracking.
Outperforms basic UTM tracking
Madlitics captures, categorizes, and persists attribution data across sessions, giving you a complete, structured view of what’s working in your marketing. Say goodbye to losing attribution when users navigate your site, struggling with formatting inconsistencies, and ingored non-UTM traffic.
Capture icon indicating data collection from various marketing channels and sources.
Capture all traffic
Madlitics categorizes all inbound leads — whether they have UTM parameters or not — so every conversion is accounted for, and you won't miss out on Organic Search, Organic Social, and Referral traffic.
Routing icon representing the flow of marketing data and attribution pathways.
Attribution across pages and sessions
A LinkedIn ad click should be attributed correctly—even if the visitor signs up on a different page later. If someone clicks an ad, browses multiple pages, then submits a form later, Madlitics persists attribution data across sessions, ensuring your reports reflect true performance.
List icon representing structured marketing data, reports, or campaign breakdowns.
Cleaner, more reliable data
Duplicate UTMs and inconsistent formatting break reports and mislead teams. Madlitics cleans and organizes attribution data before sending it to your CRM, giving you accurate insights.
Target icon symbolizing precise audience targeting and marketing campaign focus
See which content converts
Attribution isn’t just about where visitors came from—it’s about what convinced them to convert. By capturing landing page data alongside UTM parameters, Madlitics shows you which blog posts, case studies, or pricing pages drive the most revenue, helping you scale content that works.
Action icon representing campaign execution, optimization, and engagement.
Transform form submissions into actionable insights
Madlitics connects marketing touchpoints to lead generation, ensuring every form submission is fully attributed — optimize ad spend by identifying high-ROI channels, refine messaging based on what content drives engagement, make data-driven decisions with clean, structured reports, and more.