Skip to content

nullitics/nullitics

Repository files navigation

NULLITICS

Build Status GoDoc GoReportCard example Docker Image Size (latest by date) License: MIT Buy me a coffee

Zero-effort web analytics. This is a self-hosted open-source version of Nullitics. Check out https://nullitics.com for the world cheapest web analytics in the cloud.

Features

  • Privacy-focused (no cookies, fully anonymized).
  • Easy to set up (no databases, no external dependencies).
  • Meaningful, stylish dashboard.
  • Easy to understand metrics (unique visitors, page views, referrers, countries, device types).
  • Very lightweight (Docker image is under 10MB, same is the size of the executable).
  • Compliant with GDPR, ePrivacy, PECR, CCPA, and COPPA.
  • Fast (can handle 35K req/sec on my humble personal server).
  • By-pass ad-blockers.
  • Can be used as a standalone service or as a Go library.
  • You own your data.

How to use it?

Nullitics comes in several flavours:

  • Embedded (a Go library to use in your Go projects).
  • Self-hosted (a static binary or a Docker container to run on your server).
  • Cloud (the world cheapest web analytics, that also respect your users' privacy).

Library API

The package API is designed to be as simple as possible:

mux := http.NewServeMux()
...
// Create a new Nullitics collector to collect analytics
c := nullitics.New()
// Register a report endpoint to see the dashboard
mux.Handle("/_/stats/", c.Report(nil))
// Wrap mux so that every request would be recorded
http.ListenAndServe(":"+port, c.Collect(mux))

Of course, there's plenty of room for customization, see GoDoc for further details.

Also you may try out the ./cmd/example to see how Nullitics work as library.

Self-hosted container

Running container on a personal server is even simpler:

docker run -p 8080:8080 zserge/nullitics \
	-url mydomain.com \
	-dir nullitics-data \
	-loc Europe/Berlin \

You may check ./cmd/pixel to see how the standalone version works.

Of course, you can still build it yourself and run as a Linux service instead of a Docker container, if you like.

License

Code is distributed under MIT license, feel free to use it in your proprietary projects as well.