GoatCounter
Easy web analytics. No tracking of personal data.
GoatCounter is an open-source web analytics platform available as a free donation-supported hosted service or self-hosted app. It aims to offer easy-to-use and meaningful privacy-friendly web analytics as an alternative to Google Analytics, Matomo, or Umami (Web Analytics).
More on Why GoatCounter was made.
# How Visits are counted
GoatCounter ==only counts “visits” rather than “pageviews”==:
- A “pageview” is every time a page is loaded.
- A “visit” is the first time someone loads a page. Someone reloading the page or going to another page and then coming back is counted as one visit.
You almost always want to keep track of visits rather than pageviews. Otherwise someone reloading the page ten times will show up as ten times, which is not really meaningful.
This can be disabled in the site settings, at Settings → Data collection → Sessions. If it’s disabled every pageview counts as a “visit”.
# Technical details
The way visitors are identified is as follows:
- A sessionID is created as concat(siteID, User-Agent, IP).
- Store this in memory as a sessionID → UUIDv4 mapping for 8 hours.
- Store a UUID → seen_paths mapping (again in memory), so we can count new visits for different paths.
- Use the UUID in the database and such.
The IP address and User-Agent are never stored to the database or disk, and there is no conceivable way to trace the random UUID back to this.
It’s only stored in memory, which is needed anyway for basic networking to work.
See more at GoatCounter documentation
# Pseudocode
|
|
Origin:
References:
GitHub repo