By Vlad Levun, co-founder of Waves Creative · Updated November 23, 2026
In this article
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.
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.
| Location | Where in Webflow | When to use it |
|---|---|---|
| Head code | Site settings > Custom code | One snippet for every page |
| Footer code | Site settings > Custom code | Scripts that can load after content |
| Page-level code | Page settings > Custom code | Code 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.
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:
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.
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:
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.
| Symptom | Likely cause | Fix |
|---|---|---|
| No request on live site | Code saved, not published | Publish to the domain |
| Missing in one browser | Ad blocker | Test with blockers off |
| Loads only after accept | CMP or GTM consent gate | Expected where consent applies; with HubSpot's own banner the script loads first, so check cookies before consent |
| Two script requests | Duplicate code | Remove one copy |
| Data in wrong account | Wrong Hub ID | Copy 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.
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.
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.
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.
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.
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.
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.
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.
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