Website builders · 3 min setup

How to add analytics to a Wix site

To add VisitTrack to Wix, go to Settings → Custom Code, add the script tag for All pages, choose to load it once per visit, place it in Head, and apply. Wix changes pages without full reloads, and the script records each page change by itself.

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

  1. 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_ID below.

  2. 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.

  3. 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>
  4. 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

  1. Open your live domain and click between two pages in your menu.
  2. The VisitTrack live view shows you within seconds; the Pages tab lists each page.
  3. If each page change shows up twice, the snippet is set to load on each new page — switch it to load once.

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.

AttributeWhat it does
data-cookielessStore 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-localTrack on localhost and *.local — for testing an install only.
data-debugLog 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

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.