Search by

privatus / automad-privatus-analytics

ja-andrews

See how many real people visit your Automad site, without cookies. Adds the Privatus Analytics script to your pages.

Package info

github.com/Privatus-Analytics/automad-privatus-analytics

Homepage

Documentation

Type:automad-package

pkg:composer/privatus/automad-privatus-analytics

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-28 03:04 UTC

This package is auto-updated.

Last update: 2026-10-28 03:13:34 UTC


README

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

You want to know if people visit your Automad 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 extension adds the Privatus Analytics script to the pages of your Automad site. You add one line to your theme and set your site ID once. Your own visits are not counted while you are logged in, unless you turn that off. 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.

Requirements

  • Automad 2 (tested on 2.0.0-beta.68). PHP 8.2 or later.
  • A Privatus Analytics site ID. It starts with pa_. You find it in Privatus Analytics under Site settings, Tracking.

Install

In the Automad dashboard, open Packages, search for Privatus Analytics and click Install.

Or install it with Composer in the folder where Automad lives:

composer require privatus/automad-privatus-analytics

Setup

Add this line inside the <head> of your theme templates, just before </head>:

<@ PrivatusAnalytics/Tracker { siteId: 'pa_YOURSITEID' } @>

You can leave siteId out and set it in the dashboard instead. Open Shared, add a custom field named privatusSiteId and paste your site ID.

Until there is a valid site ID, the extension adds nothing to your pages.

Options

Option What it does
siteId Your Privatus Analytics site ID, like pa_7Q2K9XH3AB. If it is empty, the privatusSiteId shared field is used, then the PRIVATUS_SITE_ID environment variable. A value that does not look like a site ID prints nothing.
modules The extra tracking to load, separated by commas. engage is time on page and how far people scroll. auto is clicks on outside links, file downloads, forms people send and missing pages (404). vitals is page speed (Web Vitals). clicks is click maps. ask is short surveys on your site. Leave it out to load all five. Use '' to load none.
skipLoggedIn true by default. People logged in to the Automad dashboard get no script, so your own visits are not counted.

For example, to load only time on page and page speed:

<@ PrivatusAnalytics/Tracker { siteId: 'pa_YOURSITEID', modules: 'engage, vitals' } @>

With only a site ID, the extension prints:

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

External service

After you save a site ID, every page loads https://privatusstats.com/js/pa.js in the visitor's browser. The script sends the page address (query parameters are removed except campaign parameters), the referrer, the browser language, the screen width, the time zone name and event names to https://privatusstats.com/api/event. The visitor's IP address is read in memory to work out a rough country and to count unique visits, and it is not stored.

Development

composer install && vendor/bin/phpunit   # tag builder tests
./scripts/verify-docker.sh               # real Automad site in Docker: install, add to the theme, check pages

License

MIT. See LICENSE.