Web

Suivi d’audience

An in-house audience measurement tool for all of my sites, designed to be anonymous by construction: it counts page views and visits without cookies or IP addresses, records aggregated counters in an SQLite database, and displays them on a private dashboard with two charts, a line and bars.

  • JavaScript
  • PHP
  • SQLite
  • Docker
Suivi d’audience

Context

I wanted to track how much my sites were visited without handing that data to a third-party service, and without the consent requirements that come with classic analytics tools. The guiding thread of the project was therefore as much regulatory as technical: staying within the consent exemption defined by the French data protection authority for audience measurement. That constraint drove the architecture, a tool that stores nothing on the visitor’s device, keeps no personal data, and limits itself to aggregated counters kept separate per site.

Approach

The tool fits in a single PHP and Apache container backed by an SQLite database. The heart of the collection is a public entry point that answers with a transparent one-pixel image: each site loads this image through a short script, which increments the day’s counters for the relevant page. Nothing is written to the visitor’s device, no IP address is kept, no identifier links a visitor from one site to another, and no query string is retained, which rules out campaign parameters and any personal data. A visit is deduplicated on the browser side, without a cookie. The data therefore amounts to numbers per site, per page and per day, with retention limited to twenty-five months.

The dashboard is a password-protected page, with lockout after repeated failures and reading of the real client address provided by the reverse proxy. It shows traffic per site and overall, filterable by period, through two charts hand-drawn in SVG, a trend line and a vertical bar chart, with no external library. An option isolates a given site for display. The interface follows the system’s light or dark theme, with a toggle remembered in the browser. Instrumenting a site simply means pasting a short snippet before the end of the page body, the only parameter to change being the site name.

Deployment follows the sound pattern adopted for my other services: the container listens only locally and goes through the host’s nginx reverse proxy over HTTPS, on a dedicated subdomain, with configuration files and the database living outside the web root.

Results

A self-contained audience measurement tool, in production on my own infrastructure, giving a clear view of how much my sites are visited while staying anonymous by design. The project illustrates a complete approach, from a regulatory constraint translated into architectural choices to a containerized deployment behind a reverse proxy, by way of cookieless collection, a database designed for aggregated counters and home-made visualizations with no dependency. It is a project that shows a concern for compliance and restraint as much as command of a small web stack deployed end to end.