Install Madlitics on HubSpot-Hosted Websites and Landing Pages


Install Madlitics on your HubSpot-hosted website by adding your installation snippet to Site Header HTML in HubSpot’s settings.
This guide covers where to find your snippet and how to add it to your website. Once installed, configure your HubSpot forms so captured attribution reaches your contact records.
Create your Madlitics account, or sign in if you already have one. Complete your website setup before copying the installation snippet.


In your Madlitics dashboard, open Get Started and copy your installation snippet from Step 1.
Copy the complete snippet exactly as provided.

With your Madlitics snippet copied, the next step is getting it into HubSpot so attribution runs across all of your hosted pages. HubSpot lets you add scripts globally using the site header HTML, enabling the Madlitics snippet to run across your HubSpot‑hosted website and landing page once published.
In HubSpot, click the Settings icon in the top navigation, then open Content → Pages.
Use Choose a domain to edit its settings to select the domain where you want to install Madlitics.
Check whether the domain uses the default header settings or its own override before adding your snippet.


Paste the Madlitics snippet into this field, enabling Madlitics to load on every HubSpot-hosted page, including landing pages and website pages. Click Save to apply your changes.
Then, create a new or use an existing HubSpot‑hosted page and click Update or Publish. This pushes the script live and activates Madlitics across your site, so every visitor — including those who submit HubSpot‑hosted lead or embedded forms — can pass attribution data into your contact records.
For detailed instructions on setting up Madlitics with HubSpot-hosted forms and lead submission flows:
HubSpot-hosted setup guide: Setting up HubSpot-hosted pages and forms to collect marketing attribution.
mnbmn
Add your complete Madlitics snippet to Site Header HTML, preserving any existing code, then click Save. Create a new or use an existing HubSpot‑hosted page and click Update or Publish.



Open your published HubSpot-hosted website after saving the snippet.
Right-click the page, select Inspect, and open the Console tab. Reload the page and look for the Madlitics status message.
A Madlitics OK message confirms a successful script status check. Your forms still need the configured attribution fields to send captured data into HubSpot.

Madlitics OK confirms a successful script status check on the published page.
Troubleshooting:
• If there is NO Madlitics messaging, the script may not have been published to the live site or you may be seeing a caching issue.
• If there is a different message from Madlitics, there may be an issue with the account, plan tier, domain, etc. Feel free to reach out to the team, we're here to help.
With Madlitics installed, configure the hidden attribution fields in your HubSpot forms and connect them to contact properties.
Each configured submission can then carry the visitor’s original channel, campaign segments, and landing page data into HubSpot alongside their contact information.
HubSpot’s hosted websites and landing pages give you the flexibility to design and launch polished campaigns without leaving your CRM — while still letting you add the scripts that power your marketing stack. Adding the Madlitics snippet to your HubSpot site header ensures every visitor interaction is captured as clean, first‑party attribution data, directly tied to your contacts and reports.
That means you’ll know exactly which channels, campaigns, and pages are driving leads and pipeline, with attribution flowing automatically into your HubSpot contact records, reports, and dashboards.
If you’d like a hand getting started, our team’s here to help. We’ll walk you through the setup so you can focus on building, while Madlitics takes care of the attribution.
Answers to common questions about installing Madlitics on HubSpot