Support

Setting up Hubspot Forms for Marketing Attribution and UTM Tracking

Step-by-step setup to add Madlitics fields to Hubspot forms so every response includes marketing channel, campaign, and landing page attribution.
Attribution is broken

HubSpot's form builder makes it simple to create powerful lead capture forms that integrate seamlessly with your CRM and marketing workflows, while giving you full control over hidden fields and custom data collection. This means you can design professional forms that automatically capture Madlitics attribution data alongside every lead—revealing exactly which channels, campaigns, and landing pages drive your highest-value submissions.

In this guide, we'll show you how to connect Madlitics with HubSpot forms using hidden fields. Once configured, every form submission will include rich attribution details like channel, campaign, UTM segments, and landing page data, so you can track marketing performance directly in HubSpot reports and customer records.

💆 Heads-up: Make sure Madlitics is installed site-wide first (via script tag or tag manager). HubSpot forms need the Madlitics script running on the page to populate attribution data into hidden fields. Installing Madlitics on Framer ->  

1. Create a new form or edit an existing one

With Madlitics installed and running on your site, you're ready to build a form that captures both lead details and attribution data. In HubSpot, navigate to Marketing → Forms, then click Create form to start fresh, or select an existing form and click Edit.

Build your form however you like — add standard fields like Name, Email, Phone, or custom questions for your visitors. HubSpot's drag-and-drop editor makes this straightforward.

To enable Madlitics attribution tracking, you'll add seven Single-line text fields. These fields stay invisible to visitors but automatically populate with channel, campaign segments, landing page data, and more when the form submits. Get started by dragging a Single-line text field onto the form canvas.

Marketing → Forms → Create form → + Add → Fields → Single-line text

Marketing → Forms

Create a new form or use an existing one

Select Form Editor

Start with a blank form or use a template

+ Add → Fields → Single-line text

2a. Create and Connect New Properties; Update Field Options

To ensure attribution data flows into HubSpot contacts alongside every lead, you'll add seven text fields connected to custom properties, that automatically capture details like channel, campaign, UTM segments, and landing page without visitors seeing or interacting with them.

Create a custom property: Select the single-line text field and it's Edit field panel, under Connected property, click the Create new property button. Set the Property label to the first Madlitics field, Channel and the Internal name to channel (no spaces or underscores). Click the Create property button to save — you'll see a "Property connected" confirmation.

  • Property label: Ex. channel
  • Internal name: Make sure this has no spaces or underscores

Edit field options > Connected Property > Click 'Create new Property'

Align 'Property label' and 'Internal name' with Madlitics field values (below).
Click 'Create Property' to connect.

Madlitics Hubspot Connected Property Values

Madlitics Field HubSpot Property Label HubSpot Internal Name
Channel Channel channel
Segment1 Segment1 segment1
Segment2 Segment2 segment2
Segment3 Segment3 segment3
Segment 4 Segment4 segment4
Landing Page LP lp
Landing Page Group LPG lpg

Hubspot property is connected 🟢

2b. Madlitics field values for Hubspot

Continue customizing the current single-line text field in its Edit field panel → Field options and align with Madlitics values (below):

  • Default value: [channel]
  • Hidden: Toggle ON (hides from visitors)

Align 'Default value' with Madlitics field values, and toggle Hidden field.

Madlitics Field Values

Madlitics Field Default Value Hidden
Channel [channel] Yes
Segment 1 [segment1] Yes
Segment 2 [segment2] Yes
Segment 3 [segment3] Yes
Segment 4 [segment4] Yes
Landing Page [lp] Yes
Landing Page Group [lpg] Yes

Repeat this process for all seven Madlitics fields — Adding additional text fields, creating/connecting Hubspot properties, and updating field options to align with Madlitics values. Each field maps to a HubSpot custom property and pulls the corresponding attribution data automatically when Madlitics is running on the page.

Repeat the process of adding field, and aligning properties and field options to Madlitics field values — seven total fields will be added.

Madlitics field values for Hubspot

For additional fields and values including clickIDs (gclid/fbclid) or extra parameters, see Madlitics field values pairs.

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

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.
Property label: Segment1
Internal name: segment1
Default value: [segment1]
Hidden: yes

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.
Property label: Segment2
Internal name: segment2
Default value: [segment2]
Hidden: yes

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.
Property label: Segment3
Internal name: segment3
Default value: [segment3]
Hidden: yes

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.
Property label: Segment4
Internal name: segment4
Default value: [segment4]
Hidden: yes

Landing Page
Captures the exact page where the visitor first entered your site, recording the original entry point of the session.
Property label: LP
Internal name: lp
Default value: [lp]
Hidden: yes

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.
Property label: LPG
Internal name: lpg
Default value: [lpg]
Hidden: yes

3. Publish and test your form

With all Madlitics fields added and connected to custom properties, click Review and update in the top right to finalize your form. HubSpot forms now capture complete first-touch attribution data with every submission, flowing directly into contact records and reports.

Test the integration live: HubSpot form previews don't execute Madlitics scripts, so publish your form first. Embed it on a live page (via HubSpot page, external site, or CMS embed code), then visit that URL with UTM parameters (e.g., ?utm_source=google&utm_medium=cpc&utm_campaign=hubspot-test).

Submit the form as a visitor would. You should see values like channel: "Paid Search", segment1: "google", and landingpage: "/your-lp-url" alongside standard lead fields. HubSpot form submission showing Madlitics attribution data captured successfully—channel, UTM segments, and landing page details now flow into contact records.

Copy the embed code and paste in on your site — you’re ready to start capturing attribution data alongside your lead details.

Marketing attribution data enriches Hubspot form customer information
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.
1. Add UTM parameters to all inbound links
Any marketing effort that drives traffic — whether it’s a paid ad, an email campaign, or an organic post — should have properly structured URLs that clearly define the visitor’s origin. Setting it up is a straightforward process that starts with ensuring all inbound links include UTM parameters.

A LinkedIn campaign, for example, might link to:
https://yoursite.com/?utm_source=linkedin&utm_medium=paidsocial&utm_campaign=q1_promo
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.
2. Add hidden fields
Once you’ve added UTM tracking to your inbound links, the next step is to install Madlitics on your site and update your Framer Forms to include hidden fields that will store attribution data when a visitor submits a form automatically. Hidden fields to include:
• Channel (e.g., Paid Search, Organic Social, Direct)
• Segment 1 (Platform name: Google, LinkedIn, Twitter)
• Segment 2 (Campaign name)
• Segment 3 (Ad group, offer name, or post type)
• Segment 4 (Creative type or ad variation)
• Landing page/group (Tracking & first-touch attribution)
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.
3. Utilize attribution data
With the setup complete, every form submission in Framer now carries full attribution data, ensuring accurate insights into where leads originate. Pass this data to your CRM, analytics tools, or marketing automation platforms to track performance, refine campaigns, and optimize marketing efforts with precision.

With Madlitics now integrated into your HubSpot forms, every lead submission automatically carries precise first-touch attribution data—channel, campaign, UTM details, and landing page — directly into contact records and reports. This eliminates guesswork around what drives pipeline, empowering your team to optimize marketing spend, prove ROI, and close the loop between campaigns and revenue right inside HubSpot.

Related articles to get you started with Madlitics

Frequently asked questions

Answers to your top questions about our UTM parameters
Put attribution data to work
Sync, analyze, and automate — turn insights into action.
Automation icon indicating hands-free marketing attribution and data flow.
Sync with your CRM
Pass UTM parameters into Salesforce, HubSpot, or ActiveCampaign so your sales team knows exactly where every lead came from — no more guessing.
Analytics report icon, indicating data insights and reporting.
Built smarter reports
Use Google Sheets, Looker Studio, or Airtable to create data-driven reports that reveal which campaigns drive real revenue — helping you make informed budget decisions.
Impact measurement icon, symbolizing marketing effectiveness.
Track revenue impact
Sync UTM data with Stripe, PayPal, or Chargebee to see which campaigns generate paying customers, not just leads — so you can scale what works.
Personalization icon, representing customization features.
Personalize email campaigns
Trigger personalized email flows in Klaviyo, Mailchimp, or ConvertKit based on a lead’s original source — ensuring the right message reaches the right audience.
Visualizing your marketing impact
See how attribution data translates into actionable insights.
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.
Leads by channel
See how different marketing channels contribute to lead generation over time. Understand which ones drive the most traffic and whether your marketing mix is balanced. Shift your budget toward the highest-performing channels to maximize results.
Stacked bar chart illustrating lead volume across different marketing campaigns, including Black Friday, Retargeted, Spring Promo, Referral, and SEO. Highlights trends in campaign effectiveness.
Leads by campaign
Track inbound leads across all campaigns, whether or not they have UTM parameters. Ensure every lead is categorized correctly, including Organic and Referral traffic. Use this insight to refine messaging, targeting, and budget allocation for better performance.
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.
Conversion rate by channel
See which channels convert leads into paying customers. Some bring buyers, while others generate unqualified leads. Focus your budget on what drives revenue.
Line chart showing revenue performance by marketing campaign, comparing Google Ads, Facebook Ads, and LinkedIn Ads. Helps identify top-performing and underperforming campaigns.
Revenue by campaign
Focus your budget on campaigns that drive revenue, not just leads. Identify top performers and optimize underperforming efforts to maximize profitability.
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.