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.
Every install comes down to one script tag in the <head> of every page:
<script defer src="https://privatusanalytics.com/js/pa.js" data-site="pa_YOURSITEID"></script>
- Replace
pa_YOURSITEIDwith your site id from Site settings → Tracking. The snippet generator on that page builds the tag for you, including any options you switch on. deferloads 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 |
|---|---|
| Track outbound links, downloads, forms and 404s automatically | data-modules="engage,auto" |
| Measure Web Vitals | data-modules="engage,vitals" |
| Track a hash-routed single-page app | data-spa="hash" |
| Send pageviews yourself | data-manual="true" |
| Skip admin pages | data-exclude="/admin/*" |
The full list is in the attribute reference.
Warning: Setting data-modules replaces the default list. The
engage module (time on page and scroll depth) is on only when you leave
data-modules out or include engage in it.
Choose your platform#
Websites and site builders: HTML · WordPress · Shopify · Webflow · Squarespace · Wix · Framer · Ghost
Tag managers: Google Tag Manager · Cloudflare Zaraz
Frameworks: Next.js · Nuxt · React · Vue · SvelteKit · Astro · Remix · Angular
Static site generators: Hugo · Jekyll · Eleventy · Docusaurus
Other: AMP · No-JavaScript pixel · Electron and browser extensions · Server-side
After installing#
Verify the installation. If nothing arrives, work through No data.
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 the Privatus Analytics WordPress plugin or add the snippet to your theme, exclude admins, track WooCommerce purchases and add an opt-out shortcode.
Add cookieless analytics to your Shopify store with the app embed or theme code, then track checkout purchases and revenue with a Shopify custom pixel.
Add privacy-friendly analytics to Webflow through site-wide custom code, handle your webflow.io staging domain and track events with custom attributes.
Add cookieless analytics to Squarespace with header code injection, and track purchases with revenue from the Order Status Page without sending order details.
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 cookieless analytics to a Framer site through custom code, track single-page navigation automatically and count clicks with a data-privatus-event attribute.
Add privacy-friendly analytics to a Ghost site through code injection, and count member and newsletter signups as an event without sending email addresses.
Load the Privatus tracker from a Google Tag Manager Custom HTML tag, set consent settings, send events from GTM triggers and avoid SPA double counting.
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 cookieless analytics to Next.js with @privatus/next or next/script, for the App or Pages Router, with server-side events.
Add privacy-friendly analytics to a Nuxt app with the @privatus/nuxt module or a head script in nuxt.config, with route changes tracked automatically.
Add cookieless analytics to a React single-page app built with Vite or Create React App, using the index.html snippet or the typed @privatus/tracker client.
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 cookieless analytics to a SvelteKit app in src/app.html, track client-side navigation automatically and send client and server-side events from actions.
Add privacy-friendly analytics to an Astro site with the @privatus/astro integration or an is:inline script in your layout, with view transitions supported.
Add cookieless analytics to Remix or React Router 7 framework mode in app/root.tsx, and track conversions from actions with the server-side ingest API.
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 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 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 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 privacy-friendly analytics to a Docusaurus docs site with the scripts config in docusaurus.config.js, and track docs feedback as custom events.
Count pageviews on AMP pages with the amp-analytics component and the Privatus pixel endpoint, keep the referrer and report pages under your own domain.
Count pageviews without JavaScript using a 1×1 tracking pixel, with its parameters for page URL and referrer and its limits: pageviews only, no events.
Count screens and events in Electron apps and browser extensions by posting to the collection endpoint with virtual URLs, without creating an identifier.