privatus / typo3-privatus-analytics
Adds the cookieless Privatus Analytics tracking script to your TYPO3 site. No cookies, no cookie pop-up, no bots.
Package info
github.com/Privatus-Analytics/typo3
Type:typo3-cms-extension
pkg:composer/privatus/typo3-privatus-analytics
Requires
- php: ^8.2
- typo3/cms-core: ^13.4 || ^14.0
- typo3/cms-frontend: ^13.4 || ^14.0
Requires (Dev)
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-28 07:23:40 UTC
README
Real visitor numbers for your TYPO3 site. No cookies, no cookie pop-up, no bots.
You want to know if people visit your TYPO3 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 head of your TYPO3 pages. 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.
What this extension does
- Adds the Privatus Analytics script to the
<head>of every frontend page. - Lets each site in your TYPO3 install have its own site ID.
- Prints nothing until you set a valid site ID.
- Skips your own visits while you are logged in to the TYPO3 backend.
- Gives you a Fluid view helper to track clicks and form sends as custom events.
- Allows the script in the frontend Content Security Policy, if you turned that on.
- Only prints the browser script. It never sends events from your server and sets no cookies.
You need a Privatus Analytics account to see reports, and there is a free plan. Sign up at https://privatusanalytics.com.
Requirements
- TYPO3 13.4 or 14.
- PHP 8.2 or later.
- A Privatus Analytics site ID. It starts with
pa_.
Installation
With Composer:
composer require privatus/typo3-privatus-analytics vendor/bin/typo3 extension:setup
Without Composer, install Privatus Analytics (extension key
privatus_analytics) from the Extension Manager in the TYPO3 backend.
Setup
- In the backend, open Site Management > Sites and edit your site.
- Under Sets, add Privatus Analytics and save.
- Open Site Management > Settings, pick your site and find the Privatus Analytics group.
- Paste your site ID and save.
That's it. Every page now has this tag in its head:
<script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage"></script>
You can also put the settings straight into config/sites/<your-site>/settings.yaml:
privatusAnalytics: siteId: pa_YOURSITEID modules: 'engage,auto,vitals,clicks,ask'
Then clear the cache with vendor/bin/typo3 cache:flush.
Modules
Modules measure extra things. List the ones you want, split by commas.
| Module | What it measures |
|---|---|
engage |
Time on page and scroll depth |
auto |
Outbound links, downloads, forms and 404 pages |
vitals |
Web Vitals (how fast pages load and react) |
clicks |
Click maps |
ask |
On-site surveys |
All settings
Every setting starts with privatusAnalytics.
| Setting | What it does |
|---|---|
siteId |
Your site ID. Required. It must look like pa_AbC123. |
enabled |
false prints no script. Handy on a test site. |
modules |
The modules above. Defaults to engage. Empty means page views only. |
trackBackendUsers |
true also counts editors who are logged in to the backend. Defaults to false. |
excludedPaths |
Paths that are never counted, for example /private/*,/thank-you. |
domains |
Only count visits on these host names, for example example.com. |
spa |
How page changes without a reload are found: auto, history, hash or off. |
manual |
true turns off the automatic page view. You then call privatus.pageview() yourself. |
scriptHost |
The https address that serves /js/pa.js. Keep the default unless you host your own copy. |
See the tracker attributes for more on each one.
Track clicks and form sends
Add the namespace to your Fluid template, then put the view helper inside any link, button or form tag:
<html xmlns:privatus="http://typo3.org/ns/Privatus/Typo3Analytics/ViewHelpers" data-namespace-typo3-fluid="true"> <a href="/pricing" {privatus:event(name: 'Pricing clicked', props: {plan: 'pro'})}>See plans</a> <form action="/contact" method="post" {privatus:event(name: 'Contact form sent')}>
It prints:
data-privatus-event="Pricing clicked" data-privatus-prop-plan="pro"
The event shows up in your dashboard under Events. On a form, it fires when the
form is sent. You can also send events from your own JavaScript with
window.privatus.track('Signup', {plan: 'pro'}). See the
docs.
How it works
A small frontend middleware reads the site settings and adds the tag just before
</head> on HTML pages. It works with cached pages, and it never adds a second
tag if your template already has one.
External service
After you set 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 and any you allow), 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 find a rough country and to count unique visits, and it is not
stored.
- Terms of service: https://privatusanalytics.com/legal/terms
- Privacy policy: https://privatusanalytics.com/legal/privacy
Tests
composer install vendor/bin/phpunit
Build/integration-test.sh 13 (or 14) builds a real TYPO3 site with this
extension and checks the tag is in the page head. To run it in Docker:
docker build -t privatus-typo3-test -f Build/Dockerfile Build docker run --rm -v "$PWD":/pkg:ro privatus-typo3-test bash -c "cp -r /pkg /src/p && cd /src/p && Build/integration-test.sh 14"
Support
Questions or problems: open an issue at https://github.com/Privatus-Analytics/typo3/issues or email hello@privatusanalytics.com.
License
MIT. See LICENSE.