Matomo is open-source web analytics written in PHP with a MySQL or MariaDB database. It usually counts visits with a JavaScript tracker, but it also ships a Python importer (misc/log-analytics/import_logs.py) that reads web server logs, Caddy's JSON log among them. I run it on my VPS in Docker Compose and feed it only from the server log, without a script on the pages and without cookies: Visitor Statistics from the Server Log with Matomo.
What matters in practice
- Archiving: reports are built by
console core:archive, run hourly from cron. Fresh data shows up only after the next run. - Privacy settings apply to the whole instance: IP masking, referrer anonymisation and the deletion of old raw data hold for every site in it.
- Users since Matomo 5: new users come in by invitation. The invite link can be copied in the user list instead of waiting for the email.
- Tokens: created per user under Personal, Security. "Only allow secure requests" accepts the token in POST requests only. Tokens expire after 180 days unless you choose another date.
- API:
index.php?module=API&method=…, withperiod=range&date=<from>,<to>for any span of days. Version 5 also reports visits from AI assistants (Referrers.getAIAssistants).
- Used in
-
- Visitor Statistics from the Server Log with Matomo A self-hosted Matomo fed hourly from Caddy's access log: no tracking script, no cookies, masked IP addresses.
- Tags