Self-hosted website analytics
A privacy-friendly replacement for Google Analytics, built from scratch — visitor tracking, campaign attribution, bot filtering and a custom real-time dashboard.
The challenge
Marketing sites need reliable numbers: where visitors come from, which campaigns work, and which pages turn visitors into leads. Third-party analytics are heavy, blocked by many browsers, and send your visitors’ data to someone else.
The solution
A lightweight analytics system that runs on your own server:
- Tiny tracking script — page views, time on page, scroll depth and button clicks, sent with
sendBeaconso it never slows the site down. - Campaign attribution — UTM parameters and Google Ads conversions for phone, WhatsApp and form leads.
- Enrichment — location from IP (MaxMind GeoIP), device and browser detection.
- Bot filtering — custom detection rules; bot traffic is kept for auditing but excluded from every report.
- Dashboard — visitors over time, top pages, referrers, campaigns, devices, countries, button clicks and a real-time view.
Highlights
- Time-series database — TimescaleDB hypertables with continuous aggregates and automatic retention.
- Contact form backend — the same service stores leads and sends instant email and Telegram notifications.
- This website runs on it.