Support

Setting up Custom HTML Forms for Marketing Attribution and UTM Tracking

Step-by-step setup to add Madlitics fields to Custom HTML Forms 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.

Madlitics makes it simple to pair marketing attribution with form submissions, so you know exactly where every lead came from. By adding a set of hidden fields powered by Madlitics, your Custom HTML forms can automatically collect details like channel, campaign, and landing page — without adding any extra work for your visitors.

Step-by-Step Overview


1. Create a new form

Start by creating a new form and build it however you normally would — whether it’s a simple contact form, a newsletter signup, or a multi-step lead capture form. Madlitics doesn’t change how your form looks or functions for visitors, so you can add any visible fields you need (name, email, phone, etc.) while preparing to drop in the attribution fields behind the scenes.

2. Add Madlitics fields
To capture attribution data, you’ll need to add Madlitics fields. These fields are hidden from visitors and automatically pull in marketing details from the Madlitics script running on your site. Together, they capture a complete view of how the visitor arrived—including their channel, campaign, and the page where they landed.

Place a field (type ='Hidden') in your form to store attribution data from Madlitics. Give the input field a 'Name' name='ex.channel' and a Default Value' value='ex.[channel]'.

For example, using an HTML form, custom form, or embedded form (not a form builder platform) a sample input would look like:
<input type="hidden" name="channel" value="[channel]">

Repeat this process for the remaining Madlitics fields you want to capture. Once you’ve got all the Madlitics fields configured, save your form — you’re ready to start capturing rich attribution data alongside your lead details. Configure additional Madlitics field value pairs for deeper customization and richer insights.

Channel Category
Categorizes the visit’s marketing channel based on multiple signals, including traffic type, referring domain, and known platforms.
Field label: channel
Default value: [channel]

Segment 1
Captures the source of the traffic, identifying the specific platform, publisher, or partner that sent the visitor to your site; for paid traffic, this field records the utm_source, for organic traffic the platform, for referrals the referring domain, and for direct traffic no value is captured.
Field label: segment1
Default value: [segment1]

Segment 2
Captures the campaign-level details associated with the visit, identifying which campaign, promotion, or initiative led the visitor to your site; for paid traffic, this field records the utm_campaign, for organic traffic the referring domain, and for direct traffic no value is captured.
Field label: segment2
Default value: [segment2]

Segment 3
Captures the keyword, creative variation, or content-level detail that influenced the visit, such as a paid search term, specific ad, post type, or format; for paid traffic, this field records the utm_term, for organic traffic the full referring URL when available, and for direct traffic no value is captured.
Field label: segment3
Default value: [segment3]

Segment 4
Captures the audience, ad group, or offer associated with the visit, showing how the traffic was segmented within a campaign; for paid traffic, this field records the utm_content, and for organic and direct traffic no value is captured.
Field label: segment4
Default value: [segment4]

Landing Page
Captures the exact page where the visitor first entered your site, recording the original entry point of the session.
Field label: lp
Default value: [lp]

Landing Page Group
Captures the category or logical grouping of the landing page, allowing multiple related entry points to be analyzed under a shared identifier.
Field label: lpg
Default value: [lpg]

An example of a Custom HTML form, asking visitors to submit their full name, including Madlitics fields to capture data, that visitors will not see.

<input name="full name" data-name="Name" placeholder="Type your name" type="text" id="name">
<input type="hidden" name="channel" value="[channel]">
<input type="hidden" name="segment1" value="[segment1]">
<input type="hidden" name="segment2" value="[segment2]">
<input type="hidden" name="segment3" value="[segment3]">
<input type="hidden" name="segment4" value="[segment4]">
<input type="hidden" name="lp" value="[lp]">
<input type="hidden" name="lpg" value="[lpg]">
<input type="submit" data-wait="Please wait..." class="submit-button" value="Submit">

4. Embed the form on your site
Make sure the form is placed somewhere the Madlitics script is already installed and running (ie. your domain) — publish the form on a live page where visitors will submit it.

5. Test and publish your form
Choose a page (or post) on your site to embed the form, then publish it live. Once you’ve confirmed the data is flowing correctly, you can be confident that attribution details will pass seamlessly into your connected tools—whether that’s your CRM, analytics platform, or reporting dashboard.

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.

Once your Madlitics fields are set up, your forms are fully equipped to capture clean, consistent attribution data with every submission. Meaning, you’ll know exactly where each lead came from — whether it was a paid ad, social post, or organic search — and how they moved through your site before converting.

Getting attribution right at the form level is a big step toward smarter marketing decisions — and Madlitics makes it simple.

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.

Related articles to get you started with Madlitics

Frequently asked questions

Answers to your top questions about our platform

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.