Skip to content
Privatus-AnalyticsPublic

About

Add visitor stats to your Wix site without cookies or a cookie pop-up. Bots filtered out.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Privatus Analytics for Wix

Real visitor numbers for your Wix site. No cookies, no cookie pop-up, no bots.

You want to know if people visit your Wix site. But Google Analytics uses cookies, so in many countries you must show a cookie pop-up first (the box that asks visitors to say yes to cookies). Many people click no, so they never show up in your numbers. Bots add fake visits on top.

This Wix app adds the Privatus Analytics script to every page of your site. Paste your site id in the app's dashboard page, pick what to count, and you are done. The script sets no cookies and keeps no IP addresses. Bots are filtered out before they are counted.

So you see how many real people came, which pages they looked at and where they came from, on one simple dashboard. A report comes to your inbox each week, and you can set alerts for when traffic jumps or drops. And you don't need a cookie pop-up for your analytics.

Free plan, no card: 10,000 events a month (an event is a page view or an action you track) on up to 3 sites. Start free at privatusanalytics.com.

  • No cookies. No cookies and no hidden IDs on your visitors' devices, and no IP addresses are kept. Laws differ by country, so check your own legal advice.
  • Real people, not bots. Known bots, data centers and spam visits are left out on every plan.
  • Small and fast. The script is about 3 KB when compressed.

About this repo

A Wix CLI app (Astro based, hosted by Wix, no server of ours) with two extensions.

  • Embedded script (src/extensions/site/embedded-scripts/privatus-analytics): injects the tracker into the <head> of every page of the site.

    <script defer src="https://privatusstats.com/js/pa.js" data-site="{{siteId}}" data-modules="{{modules}}"></script>
  • Dashboard page (src/extensions/dashboard/pages/settings): the site owner pastes the site ID (pa_...) and picks modules. The page calls embeddedScripts.embedScript({ parameters: { siteId, modules } }), so Wix stores the values per site as the script's dynamic parameters. Nothing is stored by us. The page reads them back with embeddedScripts.getEmbeddedScript(). Turning tracking off calls embedScript with disabled: true.

Events only come from the tracker script. Nothing is sent from a server.

The parameter names (siteId, modules) must equal the {{placeholders}} in the HTML. A unit test enforces that. Adding or renaming a parameter later is a major app version in Wix.

Consent category

src/lib/consent.ts holds SCRIPT_TYPE. It is "ESSENTIAL", matching our install docs (/docs/install/wix, "Code type"). TODO: decide Essential or Analytics before publishing. Wix's own guidance puts analytics scripts under ANALYTICS, and a reviewer may ask. Change the one constant and run npx wix release.

Develop

npm install      # .npmrc sets legacy-peer-deps, npm 10 crashes on the peer tree without it
npm test         # vitest, validation and parameter helpers
npm run typecheck

wix build, wix dev and wix release need wix.config.json to hold your real app ID and a .env.local from npx wix env pull (both need a Wix login). The committed wix.config.json has a zero placeholder ID. With a dummy client ID the build also works offline, which is how it was checked:

WIX_CLIENT_ID=00000000-0000-0000-0000-000000000000 npx wix build

Version notes: @wix/astro 2.x and astro 5 are required for embedded scripts, @wix/astro 3 removed extensions.embeddedScript(). After a release that changes the tag, existing sites keep the old content until the owner clicks Update (or embedScript runs again).

About

Add visitor stats to your Wix site without cookies or a cookie pop-up. Bots filtered out.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages