Website builders · 3 min setup
How to add analytics to a Wix site
Updated
Wix only allows custom code on a published site with a connected domain, which in practice means a premium plan. The same steps apply to Wix Studio sites from the site dashboard.
Wix at a glance
- Where the tag goes
- Settings → Custom Code (Development & integrations)
- Options
- All pages · Load code once · Place code in Head
- Requirements
- Published site with a connected domain (premium plan)
- Page changes
- Tracked automatically
- Wix Studio
- Same Custom Code settings
How to install VisitTrack on Wix
Step 1: Copy your site id
Add your Wix domain as a site in VisitTrack and copy the snippet from the install step. Replace
SITE_IDbelow.Step 2: Open Settings → Custom Code
In your site's dashboard, open Settings and select Custom Code in the Development & integrations section. Click + Add Custom Code at the top right.
Step 3: Paste the tag and choose where it runs
Paste the snippet, give it a name like "VisitTrack", then set Add Code to Pages to All pages and choose to load the code once per visit. Under Place Code in, choose Head.
Custom Code → Head<script defer data-site="SITE_ID" src="https://visitrack.app/tracker.js"></script>Step 4: Apply
Click Apply. The snippet runs on your published site; if you don't see it on the live domain, publish the site again.
How to check VisitTrack is working on Wix
- Open your live domain and click between two pages in your menu.
- The VisitTrack live view shows you within seconds; the Pages tab lists each page.
- If each page change shows up twice, the snippet is set to load on each new page — switch it to load once.
Does VisitTrack track Wix page navigation?
Wix sites switch pages without a full reload and update the address bar through the History API. The tracker follows those changes, so each page your visitor opens is one pageview — that's why the snippet should load once per visit.
If you choose "load on each page your visitor opens", Wix inserts the script again on every page change, and the tracker would start a second time alongside the first, counting pages twice.
How to track custom events and goals in Wix
Wix's own page code (Velo) runs in a separate worker without access to the page's window, so it can't call window.visitrack(). The practical options are:
Page goals. Send form submissions to a thank-you page (most Wix form setups let you link to a page after submit), then create a page goal for that path in VisitTrack's Settings → Goals.
Automatic events. Outbound clicks, mailto:/tel: clicks (great for local businesses) and file downloads are recorded with no setup. Make a goal from contact_click to count calls and emails.
HTML embeds. Inside an Embed HTML element you control the markup, so data-vt-goal works there — but embeds run in an iframe, which the tracker deliberately ignores. Use page goals for anything inside an embed.
Revenue attribution on Wix
Wix Stores and Wix Bookings take payments through Wix's own checkout, which VisitTrack can't read, so those orders aren't attributed to a source. You'll still see which pages and channels bring visitors to product pages, and a page goal on the order confirmation page — if your setup has one with its own path — gives a conversion count. Attributed revenue needs a supported provider (Stripe, Polar, Lemon Squeezy, Paddle or Razorpay — see Revenue attribution).
Script options you might need on Wix
All optional — add them to the same tag. Full reference: script configuration.
| Attribute | What it does |
|---|---|
data-cookieless | Store nothing in the browser; the server derives a daily-rotating id. See cookieless mode. |
data-exclude="/app/*" | Never track these paths (comma-separated, * wildcard). Checked on every navigation. |
data-allow-local | Track on localhost and *.local — for testing an install only. |
data-debug | Log every event the script sends, and why it skipped one, to the console. |
data-auto="false" | Turn off automatic events (downloads, contact clicks, form submits, rage clicks, JS errors, 404s). |
Wix troubleshooting
Custom Code isn't available
Wix requires a published site with a connected domain. Connect a domain (premium plan), publish, then add the code.
Pageviews are doubled after navigating
Edit the snippet and choose to load it once per visit instead of on each new page.
Nothing tracked from the editor preview
Custom code runs on the published site. Open your live domain in a normal tab.
The snippet only appears on one page
Edit it and set Add Code to Pages to All pages.
Your cookie banner holds the script back
Wix can categorize custom code for its consent banner. In standard mode, waiting for consent is correct in the EU; cookieless mode stores nothing on the device.
Wix analytics FAQ
How do I add a tracking script to the head on Wix?
Settings → Custom Code → + Add Custom Code, paste the tag, choose All pages, load once, and Place Code in: Head, then Apply. It requires a published site with a connected domain.
Should I load the code once or on each new page in Wix?
Once. Wix navigates between pages client-side, and VisitTrack follows those navigations itself. Loading it on each page would run it twice and double-count.
Can I add VisitTrack to a free Wix site?
No. Wix only enables Custom Code for sites with a connected domain, which needs a premium plan.
Can I track Wix form submissions?
Yes, with a page goal: send the form to a thank-you page after submit and make a goal for that page in VisitTrack. Velo code can't call the tracker directly because it runs outside the page.
Does VisitTrack work on Wix Studio?
Yes. Wix Studio sites use the same Custom Code settings in the site dashboard.
Keep going
- Squarespace analyticsAdd VisitTrack to Squarespace 7.1 in Pages → Website Tools → Code Injection → Header, on Core, Plus or Advanced plans.
- Webflow analyticsAdd VisitTrack to Webflow in Site settings → Custom code → Head code, then publish — plus custom attributes for goals and Stripe Payment Link revenue.
- Framer analyticsAdd VisitTrack to Framer in Site Settings → General → Custom Code (End of <head> tag) — Framer's client-side page changes are tracked automatically.
- Google Tag Manager analyticsLoad VisitTrack from Google Tag Manager with a Custom HTML tag on All Pages — SPA-safe, consent-aware, with dataLayer events forwarded as custom events.
- Install the tracking scriptThe reference tag, CSP notes and how to check it's working.
- Custom events and signupsvisitrack(), data-vt-goal, scroll events and server-side signups.
- Use casesHow SaaS teams, indie hackers, stores and agencies use VisitTrack.
- VisitTrack vs Google AnalyticsCookie-free analytics with revenue attribution, compared honestly.
Add VisitTrack to your Wix site
Cookie-free analytics with revenue attribution, live visitors, funnels and session replays. One script tag, every feature on every plan. 14 days free, no card required.
Not on Wix? See all 29 integration guides.