Set Up HubSpot Forms to Capture UTM Parameters and Attribution

Configure hidden fields and contact properties so HubSpot submissions include original channel, campaign, and landing page data.
Attribution is broken

Connect Madlitics to your HubSpot forms so attribution data reaches the contact record alongside each submission.

This guide covers creating the seven Madlitics contact properties, configuring their hidden form fields, publishing your form, and verifying the captured values. You can use these fields in a new form or add them to an existing one.

Before starting, install Madlitics on the website where visitors arrive and submit your form.

‍

Step-by-step video walkthrough

Create new or use an existing form

Step 1: 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

Create, connect new properties

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.

Step 2a: 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. Click the Create property button to save — you'll see a "Property connected" confirmation.

  • Property label: Ex. channel
  • Internal name: Use the exact internal names listed in this guide.

‍

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.

‍

Hubspot property values with Madlitics
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 🟢

‍

‍

Configure attribution fields for Hubspot

Step 2b: 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 default 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 utm_term value for campaign-tagged visits. Use it for the keyword, ad group, audience, or other detail you include in that parameter. It does not automatically reveal a visitor’s organic Google search query.
Property label: Segment3
Internal name: segment3
Default value: [segment3]
Hidden: yes

Segment 4
Captures the utm_content value for campaign-tagged visits. Use it to distinguish creative variations, ads, or individual links within a campaign.
Property label: Segment4
Internal name: segment4
Default value: [segment4]
Hidden: yes

Landing Page
Captures the original page where the visitor entered your website. This can differ from the page where they later submit the form.
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

Embed HubSpot forms

Once your form is ready, it’s time to embed it so visitors can fill it out and Madlitics can capture attribution data.

Step 3: Click 'Review and update' in the top right to publish your form. Choose 'Get embed code', copy the code and paste it into your website where you want the form to appear, then publish or launch your site.

Your form will be live and will automatically collect Madlitics attribution data with every submission.

HubSpot form previews don’t run the Madlitics script, so you’ll need to test on a live page. Publish your page,  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. Your submission should include available attribution values, such as channel: Paid Search, segment1: google, and lp: https://www.yourwebsite.com/your-lp-url, alongside the submitted contact details.

‍

Click 'Review and update' in the top right to publish your form and get the embed code.

‍

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

‍

‍

Display attribution on the contact record

Step 4: Open a contact record and customize its property cards to display Channel, Segment1–4, LP, and LPG. Save the layout so your team can find the attribution alongside the contact’s other details.

Displaying a property does not populate it. Confirm its value through a test submission before using it in segmentation, workflows, or reports.

‍

Tailor how the attribution data appears for your team, CRM → Contacts

‍

Preview a contact record, and edit the record or property cards.

‍

Include your Madlitics attribution fields, Channel, Segment 1–4, LP, and LPG

‍

Save your Contact properties, once all the fields have been added

‍

Marketing attribution data enriches Hubspot form customer information
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

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.

Frequently Asked Questions

Answers to common questions about setting up tracking with Madlitics and HubSpot