← All articles

HubSpot Tracking Code Webflow: How to Install and Verify It

Tracking That Fires
Analytics
On this page
Copy link
LinkedIn
X

By Vlad Levun, co-founder of Waves Creative · Updated November 23, 2026

In this article

How to add the HubSpot tracking code to Webflow

To add the HubSpot tracking code to Webflow, copy the code from your HubSpot settings and paste it into Webflow under Site settings > Custom code > Head code. Save, publish the site, and then check that the code fires on the live domain. The tracking code is a short JavaScript snippet that sends page views and form activity from your site to HubSpot. Webflow requires a paid Site plan for site-wide custom code, so check Webflow's custom code guide and the pricing page for your plan. If you would rather not paste code, you can use HubSpot's Webflow app instead. The route test below covers that choice. This guide is for marketers and developers running a Webflow site with HubSpot. It covers the install, the route choice, consent and verification, but not a full GTM container build.

Key takeaways

  • Paste the code once, site-wide, in Head code. It goes live only after you publish.
  • Check your consent setup before the code fires for visitors.
  • Verify in the browser and in HubSpot, on the published domain. The Designer preview does not count.
  • The tracking code is not the HubSpot form embed. One records visits, the other collects submissions.

Find your HubSpot tracking code

In HubSpot, go to Settings > Tracking & Analytics > Tracking Code and copy the script. HubSpot's install guide shows the same screen. The script contains your Hub ID, which is the number that identifies your HubSpot account (also called the portal ID). It appears in a URL like js.hs-scripts.com/[Hub ID].js.

If a label differs in your account, look in its tracking or analytics settings.

Before you paste, search the published page source for "hs-scripts" and check page-level custom code and Embed elements. Two copies send duplicate tracking requests.

Paste the code into Webflow, step by step

  1. In Webflow, open Site settings for your site.
  2. Go to the Custom code tab.
  3. Paste the HubSpot script into the Head code field.
  4. Save your changes.
  5. Publish the site to the domain you want tracked.
LocationWhere in WebflowWhen to use it
Head codeSite settings > Custom codeOne snippet for every page
Footer codeSite settings > Custom codeScripts that can load after content
Page-level codePage settings > Custom codeCode for a single page

Use Head code as your default. The HubSpot script loads asynchronously and does not hold up the page. It starts loading early, so short visits are more likely to be recorded. Footer placement also works; HubSpot's install guide shows its recommended placement.

Webflow can publish to the webflow.io staging domain, your custom domain or both. Publish to the domain you want in HubSpot reports, and note that team visits on staging can show up in your data.

The three-question route test: code, native app or Google Tag Manager?

You can paste the code yourself, install HubSpot's app from the Webflow Apps Marketplace, or load it through Google Tag Manager (GTM), Google's tool for managing tracking tags in one place. Answer these three questions in order:

  1. Do you only need page views and form tracking? If yes, paste the code, or use the app for fewer manual steps. Webflow's listing says the app adds HubSpot tracking, embeds HubSpot forms and maps native Webflow form submissions to HubSpot, without custom code.
  2. Do you need to manage several tags without republishing Webflow? If yes, use Google Tag Manager. You change HubSpot, ad and analytics tags in GTM, not in Webflow.
  3. Do you need consent control by region? If yes, use GTM with a consent tool (consent mode). HubSpot's cookie banner controls HubSpot tracking only; other ad and analytics tags need a consent management platform, for example wired into GTM consent mode.

The trade-off is maintenance. Manual code is simplest, but every change needs a Webflow publish. The app saves set-up steps but adds a connection to maintain. GTM gives the most control, but adds another tool, more permissions and another place where the code can load twice.

Forms: tracking code vs the form embed

The tracking code records visits; it does not create forms. To collect submissions in HubSpot, embed a HubSpot form or connect a native Webflow form, for example through the HubSpot app. The tracking code can also pick up native Webflow forms through HubSpot's non-HubSpot forms feature. In HubSpot's form collection settings, check that collection is on, that test submissions appear, and that the email and name fields land in the right contact properties.

Attribution depends on timing. HubSpot links a submission to earlier page views through the hubspotutk cookie, which the tracking code sets (HubSpot's cookie list). If that cookie is not set before the visitor submits, for example because they refused consent, HubSpot creates the contact without the earlier visit history. For the full form set-up, see our Webflow HubSpot integration guide.

B2B website design. We plan, design and build Webflow sites for B2B companies that need the site to explain the offer and turn visits into enquiries. See how we work

Loading the HubSpot script and setting its cookies are separate steps. HubSpot's own banner gates the cookies while the script still loads, whereas a consent tool or GTM can hold back the script itself. Set this up before launch, not after.

This is general guidance, not legal advice. In the US, opt-out models are common for analytics, but rules vary by state, and Canada has its own rules. Across the EU/EEA and the UK, expect to need prior consent before analytics cookies are set. Switzerland's rules differ; check the rules for all your markets with legal counsel.

Decide how consent gates the script before you paste it, despite the usual "just paste the snippet" advice. Pasting first is quicker, but it can set cookies before consent. Gating first takes more setup and keeps tracking in line with your consent rules.

In many accounts, HubSpot's cookie banner and consent options are under Settings > Tracking & Analytics > Cookies. HubSpot's cookie settings guide explains the banner options and how tracking behaves before consent.

If you use another consent tool, load the HubSpot code only after consent, through your tool's script blocking or GTM. In GTM, put the script in a Custom HTML tag and fire it on the trigger your consent tool provides for an accepted choice, not on All Pages. If the Network tab then shows two hs-scripts requests, the snippet is still in Webflow's Head code as well as in GTM.

Then test it:

  1. Open the published site in a private window.
  2. Open the browser's Network tab and check what loads before you click accept.
  3. Click accept and check again.

Multilingual Webflow sites and the tracking code

With Webflow Localization, one site-wide snippet in Head code covers every locale, because all locales sit in the same Webflow site. On site plans, Localize is a paid add-on billed per locale, and you pay when you publish locales, according to Webflow's pricing page. A locale that is not published has no live pages to track.

Check that your consent tool or HubSpot's banner lets you set the consent text per language.

Locale pages sit under paths such as /de/ or /nl/, so the page URL in HubSpot shows the language. We built FBA's multilingual Webflow site. For that project, we rewrote the positioning and copy, redesigned the site architecture, and built the site with SEO set-up and conversion tracking.

How to verify the code is working

  1. Publish the site, then open the published domain in a private window.
  2. Accept cookies if a banner appears.
  3. Open developer tools, go to the Network tab, reload the page and filter for "hs-scripts". You should see a request to js.hs-scripts.com with your Hub ID in it.
  4. In HubSpot, open the tracking code settings and look for the installation check or domain status shown there.
  5. Submit a test form with a test email address. Then open that contact in HubSpot and check its activity history for page views.
SymptomLikely causeFix
No request on live siteCode saved, not publishedPublish to the domain
Missing in one browserAd blockerTest with blockers off
Loads only after acceptCMP or GTM consent gateExpected where consent applies; with HubSpot's own banner the script loads first, so check cookies before consent
Two script requestsDuplicate codeRemove one copy
Data in wrong accountWrong Hub IDCopy the code again

HubSpot will not see every visitor. Tracking covers consenting visitors whose browsers allow it; ad blockers, refused consent, several devices and long multi-touch B2B journeys all leave gaps. Consent decides whether the script loads, the script sets the hubspotutk cookie, the cookie links a submission to earlier visits, and attribution, based on the model you chose, shows the touchpoints recorded before the lead. A break at any link leaves a gap in reports.

A self-initiated study: Pipestream

Pipestream is a self-initiated study, not client work. We rebuilt a CRM homepage around a guided evaluation path: clear positioning, early proof, outcome-led capabilities, a Starter/Growth/Enterprise pricing ladder and one focused demo action. With one clear action per page, you can tie each tracked event to one decision.

Get the tracking set up as part of the site

If you want tracking planned as part of a new or reworked Webflow site, we can help.

Waves Creative is a two-person, senior-led studio in Warsaw, co-founded by Vlad Levun and Maria Fedosenko. We join your team and handle brand, website and marketing end to end. You work directly with the two founders, with no account managers. Our B2B website design work covers design, Webflow development, CMS set-up and QA.

In the first phase, we get access to your site, your analytics (GA4, short for Google Analytics 4, and Google Search Console) and your brand materials. We set the timing after the first call. If you already have a designer or developer, we can work alongside them. For example, we built Simca's Webflow site from a finished design, as a fast, maintainable site the client team updates themselves. After launch we stay on for SEO, campaigns and site improvements.

Landing pages typically start from €1,000. Other projects get a custom offer after a first call. We do not guarantee rankings or revenue. We commit to clear positioning, a deliberate call-to-action (CTA) hierarchy, and tracking so you can measure and improve results.

Book a 30-minute call

Want a team to do this for you? Waves Creative handles brand, website and marketing for growing B2B and SaaS companies. Book a 30-minute call.

Frequently asked questions

Where do I put the HubSpot tracking code in Webflow?

Put it in Site settings > Custom code > Head code, then save and publish the site. The code runs only on the published domain, so test it there and not in the Designer.

Does the HubSpot tracking code work on a Webflow free plan?

Usually not through custom code, because Webflow requires a paid Site plan for site-wide custom code. Check the HubSpot app's listing on the Webflow Apps Marketplace to see whether that route works for your plan.

Why is HubSpot not tracking my Webflow visitors?

Common causes are unpublished changes, a consent banner that blocks the code, ad blockers, a duplicate snippet or a wrong Hub ID. Check the Network tab on the published site for a request to js.hs-scripts.com. Then compare the Hub ID in that request with the one in your HubSpot settings.

Do I still need the tracking code if I embed HubSpot forms?

Yes, if you want page-view history and attribution. A form embed records the submission, while the tracking code records the visits before it, so HubSpot can show the path that led to the lead.

Can I install the HubSpot tracking code through Google Tag Manager?

Yes, you can use a Custom HTML tag that holds the HubSpot script and fires on a consent trigger where consent is required. Remove the snippet from Webflow's Head code first, so the code does not load twice.

To add the HubSpot tracking code to Webflow, paste it once in Head code, publish, and check consent on the live domain. Next, run the verification steps above on your published site.

How we checked this. Plans, prices and limits come from the vendors' official pages, checked on October 9, 2026: Webflow pricing, Webflow hosting, Webflow: legacy Editor FAQ, Webflow: legacy Editor deprecation, Webflow: HubSpot app, Webflow: Salesforce integration. Feature descriptions come from each vendor's documentation and our own Webflow work; features change often, so check the vendor's site before you buy. Spotted an error or an outdated price? Email hello@wavescreative.co and we will correct it.

About the author. Vlad Levun is co-founder of Waves Creative, a senior studio in Warsaw that joins growing companies' teams and handles brand, website and marketing end to end. Waves designs and builds client websites on Webflow, from design and development to CMS set-up and QA.

Next step

Book a 30-minute call. We'll look at your site and tell you what we'd change first.