Docs
Browse the docs

Install the Privatus Analytics tracker

Install the cookieless Privatus Analytics tracker with one script tag, set common options like auto events and Web Vitals, and find a guide for your platform.

View as Markdown

Every install comes down to one script tag in the <head> of every page:

Watch: Install website analytics in one line (no cookie banner) (2:05)

Install website analytics in one line: an open source tracker you can read, no cookies, no consent tool, and your first visitor on screen in a minute.

Transcript

Do you know what the tracking code on your site actually does? Most people pasted it years ago and have never looked.

I'm James, founder of Privatus Analytics. Give me one minute, and you'll have analytics you can read line by line.

Setting up analytics is supposed to be simple. Then it isn't. There's the tag. Then the tag manager to hold the tag. Then the consent tool, then the banner, then an afternoon making them all talk to each other. When it finally works, a script you've never read runs on every page you own. It can fingerprint devices. It can set cookies that outlast the visit. It can send things you never asked it to send. You're responsible for what it does to your visitors, and you have no idea what that is. And the numbers it gives back are missing everyone who said no to the banner you built for it. A whole afternoon, to end up with a black box and half your data.

With Privatus Analytics, you add your site, copy one line, and paste it in. That's the setup. The line is open source. You can read every bit of what it does, and so can anyone who checks your site. It sets no cookies, stores nothing on the device, and never fingerprints anyone. So there's no consent tool to wire up and no banner to design. Open your dashboard. Your first visitor shows up within seconds, and every visitor after that is counted. WordPress, Shopify, Webflow, or something you built yourself, there's a guide for each. That one line carries everything else too. Goals, events and A/B tests all run on it, so you install once and you're done.

One minute, not an afternoon. A tracker you can read, instead of one you have to trust. And every visitor in your numbers from the first day.

It takes one minute to see what you've been missing. Start free at privatusanalytics.com.

html
<script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask"></script>
  • Replace pa_YOURSITEID with your site id from Site settings → Tracking. The snippet generator on that page builds the tag for you from the options you choose there (modules, SPA mode, manual pageviews, domains, excluded paths, query parameters and path masks).
  • defer loads the script without blocking your page. The core script is a few kilobytes and sets no cookies.
  • Add options as data- attributes. The most common:
You want to… Add
Stop sending outbound link, download, form and 404 events (they count toward your usage) data-modules="engage,vitals,clicks"
Load only the core script and time on page data-modules="engage"
Track a hash-routed single-page app data-spa="hash"
Count only the first page load, not client-side navigations data-spa="off"
Send pageviews yourself data-manual="true"
Track only on certain hostnames data-domains="example.com,www.example.com"
Skip admin pages data-exclude="/admin/*"
Replace ids in paths data-mask="/users/*->/users/:id"
Keep extra query parameters data-params="page,sort"
Test on localhost data-allow-local="true"
See what would be sent, with nothing sent data-debug="true" (Test with nothing sent)

The full list is in the attribute reference.

The snippet turns on every module, so time on page, automatic events, Web Vitals and click maps all have data from the start. Remove a name from data-modules to turn that module off.

Warning: A report whose module isn't listed stays empty. Without the data-modules attribute the tracker loads engage only (time on page and scroll depth).

Choose your platform#

Websites and site builders: HTML · WordPress · Webflow · Squarespace · Wix · Framer · Ghost · HubSpot · Carrd · Bubble · Super · Jimdo · Webnode · Tilda · Webstudio · Dorik · Umso · Unicorn Platform · Softr · Durable · Hostinger · Blogger · Micro.blog · Netlify

Landing pages and funnels: Unbounce · Leadpages · Instapage · GoHighLevel · ClickFunnels · Systeme.io

Online stores: Shopify · WooCommerce · BigCommerce · Magento · Ecwid

Courses and creators: Kajabi · Teachable · Thinkific · Podia

Booking embeds: Calendly · Cal.com · SavvyCal

Content management systems: Drupal · Joomla · Craft CMS · Statamic · Kirby · TYPO3 · Grav · Publii · MediaWiki · Discourse

Tag managers: Google Tag Manager · Cloudflare Zaraz

Frameworks: Next.js · Nuxt · React · Vue · SvelteKit · Astro · Remix · Angular · Gatsby · Ember · Inertia.js · Turbo / Hotwire

Server frameworks: Ruby on Rails · Laravel · Django

Static site generators: Hugo · Jekyll · Eleventy · Hexo

Docs tools: Docusaurus · VitePress · VuePress · MkDocs · Sphinx / Read the Docs · Mintlify · Nextra · Docsify

Other: Electron and browser extensions

Every platform also has a short page with its steps under Integrations.

Site settings → Tracking also shows short steps for the most common platforms, with your site id already in the code.

Test with nothing sent#

To see exactly what the tracker would send before it sends anything, add data-debug="true" to the script tag:

html
<script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask" data-debug="true"></script>

Open the browser console and use the page. With data-debug="true":

  • every hit is logged to the console, prefixed [privatus], with the exact request body,
  • nothing is sent: no request leaves the browser, so your data stays clean,
  • a hit that is skipped logs the reason ([privatus] not sent: opted out),
  • it works on localhost and other local hosts.

Remove the attribute when you are done: while it is set, no data is collected. More in Debug mode, and every field is explained in What the tracker sends.

After installing#

Verify the installation. If nothing arrives, work through No data.

Add the analytics script to an HTML site

Add privacy-friendly analytics to a hand-written or server-rendered HTML site with one script tag, turn on engagement and auto events, and track custom events.

Install Privatus Analytics on WordPress

Install our free plugin from the WordPress plugin directory and paste your site id, or add the snippet to your theme yourself.

Install Privatus Analytics on Shopify

Add cookieless analytics to your Shopify store with one snippet in your theme code, then track checkout purchases and revenue with a Shopify custom pixel.

Add Privatus Analytics to Shopify Hydrogen

Count real visitors on a Shopify Hydrogen storefront without cookies, track Add to Cart in the browser and record purchase revenue from Shopify checkout.

Add Privatus Analytics to Webflow

Add privacy-friendly analytics to Webflow through site-wide custom code, handle your webflow.io staging domain and track events with custom attributes.

Add Privatus Analytics to Squarespace

Add cookieless analytics to Squarespace with header code injection, and track purchases with revenue from the Order Status Page without sending order details.

Add Privatus Analytics to Wix

Add privacy-friendly analytics to a Wix site as custom code in the head, count page navigations once and set the code type to Essential for your consent banner.

Add Privatus Analytics to Framer

Add cookieless analytics to a Framer site through custom code, track single-page navigation automatically and count clicks with a data-privatus-event attribute.

Add Privatus Analytics to Ghost

Add privacy-friendly analytics to a Ghost site through code injection, and count member and newsletter signups as an event without sending email addresses.

Add Privatus Analytics to Blogger

Add privacy-friendly analytics to a Blogger blog by adding the snippet to your theme's HTML head, then save the theme.

Add Privatus Analytics to Bubble

Add privacy-friendly analytics to a Bubble app through the header script field in Settings, and count single-page navigation once per page.

Add Privatus Analytics to Carrd

Add privacy-friendly analytics to a Carrd site with a hidden Embed element in the head, then publish. Carrd Pro Standard or higher is required.

Add Privatus Analytics to Dorik

Add privacy-friendly analytics to a Dorik website with the Header Code field in the Advanced tab of Site Settings, then publish.

Add Privatus Analytics to Durable

Add privacy-friendly analytics to a Durable website by pasting the snippet into the Head Code box under Custom code in Settings.

Add Privatus Analytics to GoHighLevel

Add privacy-friendly analytics to HighLevel funnels and websites with the Head tracking code field in the Settings tab.

Add Privatus Analytics to Hostinger Website Builder

Add privacy-friendly analytics to a Hostinger Website Builder site with the Custom code field in Integrations, then update the site.

Add Privatus Analytics to HubSpot CMS

Add privacy-friendly analytics to HubSpot pages, blog and landing pages with the Site Header HTML setting in Content settings.

Add Privatus Analytics to Instapage

Add privacy-friendly analytics to Instapage landing pages with a workspace script in the head, or one page at a time in HTML/CSS.

Add Privatus Analytics to Jimdo

Add privacy-friendly analytics to a Jimdo Creator website by pasting the snippet into Edit Head in the site settings.

Add Privatus Analytics to Leadpages

Add privacy-friendly analytics to a Leadpages landing page by pasting the snippet into the Head Section Tracking Code field.

Add Privatus Analytics to Micro.blog

Add privacy-friendly analytics to a Micro.blog site with the Custom Footer on the Design page, which runs on every page.

Add Privatus Analytics to Softr

Add privacy-friendly analytics to a Softr app by pasting the snippet into the header section of Custom Code in the Settings panel.

Add Privatus Analytics to Super

Add privacy-friendly analytics to a Notion site built with Super by pasting the snippet into the site-wide Head code tab.

Add Privatus Analytics to Tilda

Add privacy-friendly analytics to a Tilda website with the HTML code for the head section in Site Settings, then republish your pages.

Add Privatus Analytics to Umso

Add privacy-friendly analytics to an Umso site with the Header Code field under Custom Site Code, then publish to see it run.

Add Privatus Analytics to Unbounce

Add privacy-friendly analytics to every Unbounce landing page on a custom domain with Script Manager, placed in the head.

Add Privatus Analytics to Unicorn Platform

Add privacy-friendly analytics to a Unicorn Platform site through the Global HTML code field in the general settings.

Add Privatus Analytics to Webnode

Add privacy-friendly analytics to a Webnode website with the HTML header field in Website Settings, available on premium plans.

Add Privatus Analytics to Webstudio

Add privacy-friendly analytics to a Webstudio project with the global Custom Code field in Project settings, then publish.

Add Privatus Analytics to a Netlify site

Add cookieless analytics to any site hosted on Netlify with snippet injection, with no code change or redeploy, and leave deploy previews out of your reports.

Install Privatus Analytics with Google Tag Manager

Load the Privatus Analytics tracker from a Google Tag Manager Custom HTML tag, set consent settings, send events from GTM triggers and avoid double counting.

Load Privatus Analytics with Cloudflare Zaraz

Load the Privatus Analytics tracker through Cloudflare Zaraz with a Custom HTML tool, handle Zaraz single-page app support and send events from your site.

Add Privatus Analytics to BigCommerce

Add cookieless analytics to a BigCommerce store with Script Manager, one script in the head of every storefront page, and check the consent category.

Add Privatus Analytics to Ecwid

Add cookieless analytics to an Ecwid Instant Site with the custom JavaScript code setting, or to the website where you embed your Ecwid store.

Add Privatus Analytics to Magento and Adobe Commerce

Add cookieless analytics to Magento or Adobe Commerce with the HTML Head scripts field in Design Configuration, and allow the script in your CSP.

Add Privatus Analytics to WooCommerce

Add cookieless analytics to a WooCommerce store, then track each purchase with its total and currency from the thank you page without order details.

Add Privatus Analytics to Cal.com

Count Cal.com bookings in your analytics by listening for the embed's booking event on your own website and sending a Booking event without personal data.

Add Privatus Analytics to Calendly

Count Calendly bookings in your analytics by listening for the embed's scheduled event on your own website and sending a Booking event without personal data.

Add Privatus Analytics to ClickFunnels

Add cookieless analytics to ClickFunnels 2.0 with the tracking codes in site settings or the custom header code in a funnel's settings.

Add Privatus Analytics to Kajabi

Add cookieless analytics to a Kajabi site with Header Page Scripts in site details, and learn which checkout pages the site-wide code does not reach.

Add Privatus Analytics to Podia

Add cookieless analytics to a Podia site with the website tracking code field in Analytics settings, and see where the code does not run.

Add Privatus Analytics to SavvyCal

Count SavvyCal bookings in your analytics by listening for the embed's scheduled event on your own website and sending a Booking event without personal data.

Add Privatus Analytics to Systeme.io

Add cookieless analytics to Systeme.io funnels with the account-wide tracking code box or a page's header code, and count each funnel page once.

Add Privatus Analytics to Teachable

Add cookieless analytics to a Teachable school with a global head code snippet, and learn what the snippet does not reach on SSO login and checkout.

Add Privatus Analytics to Thinkific

Add cookieless analytics to a Thinkific site with the Site Footer Code field in Code and Analytics settings, and see which checkout page it skips.

Add Privatus Analytics to Craft CMS

Add cookieless analytics to Craft CMS 5 with one snippet in your Twig layout that loads in production only, with no cookies and no banner.

Add Privatus Analytics to Drupal

Add cookieless analytics to a Drupal site with our optional module or with one snippet in your theme's html.html.twig, no cookies and no banner.

Add Privatus Analytics to Grav

Add cookieless analytics to a Grav site with one snippet in your theme's base.html.twig head block, with no cookies and no consent banner.

Add Privatus Analytics to Joomla

Add cookieless analytics to Joomla 4, 5 or 6 with our optional system plugin or by adding one snippet to a child template, with no cookies.

Add Privatus Analytics to Kirby

Add cookieless analytics to a Kirby site with one snippet in the header snippet of your theme that skips debug mode, with no cookies or banner.

Add Privatus Analytics to MediaWiki

Add cookieless analytics to a MediaWiki site by loading the tracker from MediaWiki:Common.js for every reader, with no cookies and no banner.

Add Privatus Analytics to Publii

Add cookieless analytics to a Publii static site with the Advanced Head Tag Manager and its head code field, with no cookies and no banner.

Add Privatus Analytics to Statamic

Add cookieless analytics to a Statamic site with one snippet in layout.antlers.html that loads only in production, with no cookies and no banner.

Add Privatus Analytics to TYPO3

Add cookieless analytics to TYPO3 with TypoScript headerData in your site package that loads in the Production application context only.

Add Privatus Analytics to Next.js

Add cookieless analytics to Next.js with next/script, for the App or Pages Router, with custom events from client components.

Add Privatus Analytics to Nuxt

Add privacy-friendly analytics to a Nuxt app with a head script in nuxt.config. Route changes are tracked automatically and events are one call.

Add Privatus Analytics to a React app

Add cookieless analytics to a React single-page app built with Vite or Create React App, with the index.html snippet and custom events from components.

Add Privatus Analytics to a Vue app

Add privacy-friendly analytics to a Vue 3 app with a snippet in index.html, track Vue Router history or hash navigation and send custom events from components.

Add Privatus Analytics to SvelteKit

Add cookieless analytics to a SvelteKit app in src/app.html, track client-side navigation automatically and send custom events.

Add Privatus Analytics to Astro

Add privacy-friendly analytics to an Astro site with an is:inline script in your base layout. View transitions are supported and nothing is bundled.

Add Privatus Analytics to Remix

Add cookieless analytics to Remix or React Router 7 framework mode in app/root.tsx, with client navigations tracked automatically.

Add Privatus Analytics to Angular

Add privacy-friendly analytics to an Angular app in src/index.html, handle hash location routing and track custom events from an injectable Angular service.

Add Privatus Analytics to Django

Add cookieless analytics to a Django project with one snippet in base.html and a small context processor that keeps your site id in settings.

Add Privatus Analytics to Ember.js

Add cookieless analytics to an Ember.js app with one script tag in app/index.html, with router transitions counted as page views automatically.

Add Privatus Analytics to Gatsby

Add cookieless analytics to a Gatsby site with setHeadComponents in gatsby-ssr.js, so the tracker is in every page's head in production builds.

Add Privatus Analytics to Hexo

Add cookieless analytics to a Hexo blog with a small script that injects the tracker before the closing head tag, whichever theme you use.

Add Privatus Analytics to Inertia.js

Add cookieless analytics to an Inertia.js app with one snippet in the server-side root template, so every page visit is counted once.

Add Privatus Analytics to Laravel

Add cookieless analytics to a Laravel app with one snippet in your Blade layout wrapped in @production so local and test runs are not counted.

Add Privatus Analytics to Ruby on Rails

Add cookieless analytics to a Rails app with our privatus-analytics-rails gem and one layout helper, or with a plain script tag in production only.

Add Privatus Analytics to Turbo and Hotwire

Add cookieless analytics to an app that uses Turbo Drive, Hotwire or Turbolinks with one script tag in the head that counts each visit once.

Add Privatus Analytics to Hugo

Add cookieless analytics to a Hugo site with a head partial that loads the tracker only in production builds, and keep your site id in the Hugo config.

Add Privatus Analytics to Jekyll

Add cookieless analytics to a Jekyll site in your head include, load it only in production builds and keep the site id in _config.yml, on GitHub Pages too.

Add Privatus Analytics to Eleventy (11ty)

Add cookieless analytics to an Eleventy (11ty) base layout, with a global data file so the tracker loads in production builds but not in eleventy --serve.

Add Privatus Analytics to Docusaurus

Add privacy-friendly analytics to a Docusaurus docs site with the scripts config in docusaurus.config.js, and track docs feedback as custom events.

Add Privatus Analytics to Docsify

Add cookieless analytics to a Docsify docs site with one script tag in index.html, with hash routes counted as separate page views.

Add Privatus Analytics to Mintlify

Add cookieless analytics to a Mintlify docs site with a custom JavaScript file in your docs repo, since Mintlify has no custom script tag option.

Add Privatus Analytics to MkDocs

Add cookieless analytics to a MkDocs site with a Material for MkDocs override of the extrahead block, or with a small extra_javascript file.

Add Privatus Analytics to Nextra

Add cookieless analytics to a Nextra 4 docs site with next/script in the App Router root layout, with page navigation counted automatically.

Add Privatus Analytics to Sphinx and Read the Docs

Add cookieless analytics to a Sphinx docs project, hosted on Read the Docs or elsewhere, with html_js_files in conf.py and no theme changes.

Add Privatus Analytics to VitePress

Add cookieless analytics to a VitePress docs site with the head option in .vitepress/config, with page changes counted as page views automatically.

Add Privatus Analytics to VuePress

Add cookieless analytics to a VuePress 2 docs site with the head option in your config file, with route changes counted as page views automatically.

Add Privatus Analytics to Discourse

Add cookieless analytics to a Discourse forum with the free theme component, or paste one snippet into your theme's Head tab.

Analytics for Electron apps and browser extensions

Count screens and events in Electron apps and browser extensions by posting to the collection endpoint with virtual URLs, without creating an identifier.