Installing Madlitics on Hubspot-hosted websites and landing pages


HubSpot’s hosted websites and landing pages are a powerful way to run campaigns and capture leads without leaving your HubSpot environment. With HubSpot, you can build and launch polished pages directly inside the platform, and when you need to add custom scripts HubSpot gives you straightforward controls to include them site‑wide.
In this guide, we’ll walk through two parts: first, creating your Madlitics account and grabbing your installation snippet, and then adding that snippet into the head code of your HubSpot‑hosted site using HubSpot’s settings. Once installed and published, this snippet will load on all HubSpot‑hosted pages so Madlitics can capture clean, accurate attribution data from every visitor, whether they come from a landing page, blog post, or any other HubSpot‑hosted URL.
Prerequisite: Before you can install Madlitics, you’ll need to create a Madlitics account. Registration unlocks your dashboard, and copy the code snippet that powers attribution. This step only takes a minute and ensures you have everything ready before moving on to the platform-specific setup.
Step 1: Create your Madlitics account
Sign up for a free trial on the Madlitics website to get started. Creating an account unlocks your dashboard, where you’ll manage your sites, access setup guides, site preferences, and access the code snippet you’ll need to install Madlitics


Step 2: Access your installation snippet
Once you’ve registered and logged in, you’ll land in your dashboard’s 'Get Started' section. Here, you’ll find your unique Madlitics installation snippet, which is required to enable tracking on your site.





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.
Step 3: Navigate to HubSpot settings
Start by opening your HubSpot dashboard and clicking the Settings icon in the top navigation.
From the left-hand sidebar, navigate to Tools → Content → Pages. This is where you can manage global page settings, including custom code.


Inside the HubSpot settings, locate the Pages settings, via the Tools section, inside the Content dropdown. You’ll see an option for Site header HTML, which controls scripts added to the <head> of pages.
Step 4: 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.



To confirm that the Madlitics snippet is working, open your live site in a browser and inspect the page source. Right-click anywhere on the site, select Inspect, and switch to the Console tab. Look inside the 'Madlitics OK' messaging. If you see it, Madlitics is installed and setup correctly.
Now you're ready to configure hubspot forms to collect attribution data, utm parameters, google ads, and more.

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.
• Configure Hubspot forms for hosted-pages and sites
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.