How to add analytics to Wix

Wix supports custom code in the site's head through its Custom Code settings. This feature needs a Premium plan and a connected domain.

No cookies, no banner ~3 KB script About 2 minutes

Before you start

Create a free Cool Analytics account and add your site. You'll get a site ID — replace YOUR_SITE_ID in the code below with it. The dashboard shows the snippet with your ID already filled in.

Install on Wix

  1. 1In your Wix dashboard, go to Settings and open Custom Code (under Advanced).
  2. 2Click + Add Custom Code, paste the snippet, and give it a name.
  3. 3Choose All pages, load code once, and place it in Head. Click Apply.
Settings → Custom Code
<script defer src="https://coolanalytics.dev/hb.js" data-site="YOUR_SITE_ID"></script>

Check that it works

Open your live site in a new tab, then open your Cool Analytics dashboard. Your visit appears on the live map within seconds — with the page you're on, where you came from and your browser.

Nothing showing up? Make sure you're looking at the published site (not a preview or editor), that an ad blocker isn't blocking the script, and that you're not testing on localhost.

Track signups, purchases and clicks

Pageviews, sources, countries and outbound link clicks are tracked automatically. For the moments that matter to you, send a custom event. Events named like a signup show up as signups, and events with an amount show up as revenue — on the live map and per traffic source.

custom events
// anywhere in your Wix site's browser code
window.hb?.track("signup");

// with an amount, it shows up as revenue
window.hb?.track("purchase", { amount: 49 });

Wix tips

  • Custom Code only works on published sites with a connected domain on a Premium plan.
  • Wix sites switch pages client-side; those navigations are tracked automatically.

Want to keep your own visits out of the stats? Open your site once with #hb-ignore at the end of the URL. That browser is excluded until you visit with #hb-track.

Wix analytics FAQ

Can I use it on a free Wix site?+

No. Wix only enables Custom Code for Premium sites with a connected domain.

Does it work with Wix Studio?+

Yes. Wix Studio sites have the same Custom Code settings in the site dashboard.

Do I need Wix's cookie banner for it?+

Not for Cool Analytics, which sets no cookies. Wix itself may set cookies of its own.

See who's on your Wix site right now.

One line of code. No cookies. 7 days free.