OpenAltFinder
GoatCounter

GoatCounter

Privacy-friendly web analytics with no cookies or personal data, shipped as a single Go binary you can self-host.

screenshot2.png
screenshot3.png
screenshot.png
1 / 3

GoatCounter is an open-source web analytics platform built as a simpler, privacy-aware alternative to Google Analytics and Matomo. It runs as a free hosted service at goatcounter.com or on your own server. The default integration is one script tag adding roughly 3.5 KB, and there are no cookies or cross-site identifiers: unique visits are counted with a non-identifiable hash that is discarded after a short window, so a GDPR consent banner is normally unnecessary. Reports cover pageviews, referring sites, campaigns, browsers, screen sizes, and approximate location, and the interface is built with screen-reader accessibility as a first-class requirement.

Data can arrive four ways: the JavaScript tracker, a no-JavaScript image pixel, your application's backend middleware through the JSON API, or an import of nginx, Apache, Caddy, or CloudFront log files. Events are declared with a data-goatcounter-click attribute or fired from JavaScript through count({ event: true }), and campaigns are picked up automatically from utm_campaign or campaign parameters plus a source such as utm_source, ref, or src. Paths can be overridden, single-page apps are supported, one account can hold several sites, and everything is exportable as JSON or CSV on demand.

Self-hosting is deliberately small: a single statically compiled binary with no runtime dependencies beyond a SQLite file or a PostgreSQL connection. SQLite is the default and copes with smaller sites, while PostgreSQL is recommended when traffic is spread across many distinct pages. Official Docker images, Podman, and a compose file with SQLite and PostgreSQL variants are provided, and the server can terminate TLS itself with automatic ACME certificates. Building from source needs Go 1.21 or newer, and database migrations run with goatcounter db migrate or automatically via the -automigrate flag.

Frequently Asked Questions

How does GoatCounter count unique visitors without cookies?

It builds a non-identifiable hash from data such as the IP address, User-Agent, and site, then throws the underlying values away. The hash rotates on a schedule, so a returning visitor is not tracked across days and no durable identifier exists on the client. Sessions work the same way, which is why the dashboard reports visits without ever exposing an individual person.

How do I track events and campaigns?

Add data-goatcounter-click to any element and its clicks are recorded as events; leave the value empty and GoatCounter falls back to the element's name or id. From JavaScript, call window.goatcounter.count with event set to true, using the path as the event name. Campaigns need no setup at all: they are read from utm_campaign or campaign, with an optional source from utm_source, ref, src, or source. Add data-goatcounter-no-session to count every click rather than one per session.

Can I send pageviews without JavaScript?

Yes, in three ways. There is an image-based tracking pixel for environments where scripts are not allowed, a JSON API that your backend middleware can call directly, and a logfile importer that parses nginx, Apache, Caddy, or CloudFront logs. The importer works on the hosted service as well as on a self-hosted instance, which makes it practical to backfill history from servers you already run.

What does self-hosting GoatCounter require?

One statically compiled binary and either a SQLite file or a PostgreSQL connection. SQLite is the default and is fine for most small sites, while PostgreSQL performs better when pageviews are spread across a very large number of distinct pages. Docker images, Podman, and a compose file with SQLite and PostgreSQL variants are provided, and the server can handle TLS with automatic ACME certificates. Building from source needs Go 1.21 or newer, and /status is available for health checks.

Does GoatCounter offer an API and data export?

Yes. API tokens can be created per site and used against the JSON API, which is also how backend middleware and scripts submit pageviews. Full data can be exported as JSON or CSV at any time, so leaving the hosted service does not strand your history. A small visitor counter endpoint is available too, for embedding a live hit count on a page.

OpenAltFinder Score
63/100
Project Health (50%)
69/100
License (20%)
0/100
Self-hostable (20%)
100/100
Recency (10%)
85/100
How scoring works
Project Details
Platforms
Web
License
EUPL-1.2
Self hostable
Yes
Repository details
Version
v2.7.0
Created
5/28/2019
Stars
6,156
Forks
286
Open issues
59
Last commit
9/27/2026

Updated 11/12/2026, 12:01:17 PM

View Repository
Repository activity
Sponsor GoatCounter

Get the latest open source alternatives delivered weekly.
Discover tools that give you freedom from proprietary software.

Similar open source alternatives