Quick Answer
To add the HubSpot tracking code to a Wix site, copy the embed code from HubSpot (Settings > Tracking & Analytics > Tracking code), then in your Wix dashboard go to Settings > Custom Code (in the Advanced section), click "+ Add Custom Code," paste the snippet, name it, set it to load on all pages, place it in "Body - end," and click Apply. Then verify: load your site, confirm the script fires, and check that page views appear in HubSpot's traffic analytics. The whole job takes about fifteen minutes — the details below cover the pitfalls that make it take two weeks. Vantage Point's HubSpot team handles tracking-code installs as part of every CRM onboarding.
TL;DR
- The HubSpot tracking code is unique per account and required for analytics on any site not hosted on HubSpot — including Wix.
- On Wix, it installs through Settings > Custom Code, set to all pages, placed at Body - end.
- Install the code exactly once; if more than one HubSpot tracking code loads, only the first one fires.
- Add your Wix domain to HubSpot's tracking settings so analytics attribute traffic to the right site.
- Verify with a live page view and HubSpot's traffic analytics before declaring victory.
What Does the HubSpot Tracking Code Actually Do on a Wix Site?
The tracking code is a JavaScript snippet unique to your HubSpot account. On pages it touches, it lets HubSpot monitor traffic, record page views, recognize returning visitors, and associate browsing activity with contact records once a visitor identifies themselves — typically by submitting a form or clicking a tracked email link.
Three things it does that matter for a Wix site specifically:
- Captures form context. On external pages, the tracking code lets HubSpot recognize and capture submissions from forms — including non-HubSpot forms — so leads landing in your Wix forms can flow into the CRM.
- Powers features on the page. HubSpot live chat and chatbot widgets depend on the tracking code being present. No code, no widget.
- Feeds analytics and attribution. Traffic analytics, page-type reporting, and contact-create attribution all depend on the code firing on your pages.
Just as important is what it does not do. The tracking code does not create or install forms — it observes them. It does not work on AMP pages. And ad blockers can interfere with it, so a small slice of visitors will always be invisible.
How Do You Install the HubSpot Tracking Code on Wix, Step by Step?
HubSpot's own documentation covers Wix explicitly. The sequence:
- Copy the tracking code from HubSpot. In your HubSpot account, click the settings icon, then navigate to Tracking & Analytics > Tracking code (in accounts on free tools or Marketing Starter only, look for Tracking Code directly in the left sidebar). Click Copy in the Embed code section — or use "Email to my web developer" if someone else will install it.
- Open your Wix site's dashboard and go to Settings.
- Click the Custom Code tab in the Advanced section.
- Click "+ Add Custom Code" at the top right.
- Paste the tracking code into the text box.
- Name it — "HubSpot Tracking Code" keeps things obvious for whoever maintains the site next.
- Under "Add Code to Pages," select All pages and use the dropdown to choose "Load code on each new page." Partial coverage is the most common install mistake — a page without the code is invisible to HubSpot.
- Under "Place Code in," select "Body - end." This matches HubSpot's guidance to install before the closing body tag.
- Click Apply to save.
Two Wix-specific notes. First, adding custom code to a Wix site requires a Wix plan that supports it — free Wix plans cannot add custom code, so confirm the site's plan before you start. Second, Wix renders pages dynamically; the "Load code on each new page" option is what keeps tracking alive as visitors move between pages.
What Should You Configure in HubSpot After Installing?
Installing the snippet is half the job. Two settings on the HubSpot side complete it:
- Add your site domain to tracking settings. If you host a domain or subdomain externally, HubSpot needs it added under your analytics settings so traffic from that domain is included in reports rather than discarded or misattributed.
- Decide on consent tooling. Depending on where your visitors are, cookie-consent requirements may apply before analytics scripts fire. Wire the tracking code into your consent banner logic rather than around it.
How Do You Verify the Tracking Code Works?
Do not close the task until you have seen data move. A practical verification pass:
- Confirm one instance. View your page source or use browser developer tools to confirm the HubSpot script loads exactly once per page. HubSpot warns that when multiple tracking codes are present, only the first one fires — duplicates do not double your data, they just create confusion.
- Generate a known visit. Open your site in a fresh browser session, click through a few pages, and note the time.
- Check traffic analytics. In HubSpot, open Traffic Analytics and confirm page views from your domain appear. Allow a short processing delay before concluding anything is broken.
- Test the full loop. Submit a test entry through your site's form and confirm the submission — and the visitor's page-view history — lands on a contact timeline in HubSpot.
If the code is installed but no data appears, work the usual suspects: the snippet is on some pages but not all, the domain was never added to HubSpot's settings, an ad blocker or consent banner is suppressing the script, or a security policy on the site is blocking it. Security-policy blocks are their own diagnosis path — if your site runs a strict Content Security Policy, the fix is allowlisting HubSpot's domains rather than weakening the policy.
What Are the Common Wix-Specific Pitfalls?
- Code on the homepage only. Adding the snippet to one page template instead of "All pages" leaves the rest of the site dark. Analytics will look plausible but wrong.
- Double installation. The tracking code in Custom Code plus a second copy injected through a different Wix app or an HTML embed widget. Pick one lane.
- Wrong placement. Header placement can work, but HubSpot's documented Wix steps specify Body - end; match the documentation before improvising.
- Assuming forms come along for free. The tracking code captures submissions from existing forms, but replacing a basic Wix contact form with an embedded HubSpot form is usually the better end state — native HubSpot forms give you progressive profiling, dependent fields, and cleaner list-building.
- Forgetting the replatform question. If a site migration to HubSpot CMS is on the roadmap anyway, tracking-code work is still worth doing now — the historical data becomes the baseline you compare the new site against.
How Vantage Point Helps
Vantage Point's HubSpot consultants handle tracking-code installation, domain configuration, and verification as a standard part of portal setup — and go further, wiring forms, consent behavior, and attribution so the data you collect is data you can act on. For teams connecting a Wix or other external site to a new portal, our CRM and marketing automation services cover the whole path from tracking code to working funnel. Senior consultants only — no junior handoffs; the experts you meet are the experts who deliver.
Is Your Website Actually Talking to Your CRM?
Vantage Point can install, verify, and govern your HubSpot tracking so every page view and form fill lands where your team can use it. Talk to Vantage Point about connecting your site to HubSpot.
Frequently Asked Questions
Does the HubSpot tracking code work on Wix?
Yes. HubSpot's official documentation includes Wix-specific steps: paste the snippet in Settings > Custom Code, apply it to all pages, and place it at Body - end. The site needs a Wix plan that permits custom code.
Where exactly do I paste the HubSpot tracking code in Wix?
In your Wix dashboard: Settings, then the Custom Code tab under Advanced, then "+ Add Custom Code." Paste the snippet, name it, select All pages with "Load code on each new page," choose Body - end, and click Apply.
Can I install the tracking code on a free Wix plan?
No. Wix restricts custom code to sites on plans that support it. If the Custom Code option is missing from your Wix settings, the plan is the blocker — upgrade the plan or consider whether the site belongs on a different platform.
Do I need the tracking code if I only use HubSpot forms?
HubSpot form embeds can receive submissions without the tracking code, but you lose everything around the submission: page views, visitor sessions, traffic analytics, and the browsing history that makes a contact record useful. Install the code.
Why is the code installed but no data shows in HubSpot?
Work the checklist: confirm the snippet loads once on every page, confirm your domain is added in HubSpot's tracking settings, rule out ad blockers and consent banners on your test visit, and check for a Content Security Policy blocking HubSpot's script domains.
Should I use Google Tag Manager instead of Wix Custom Code?
You can — HubSpot documents a GTM install path using a Custom HTML tag with an All Pages trigger. On Wix specifically, the native Custom Code panel is simpler and one less system to maintain; use GTM if it already manages your other scripts.
