Introduction
Open Analytics is an open-source web analytics stack: a Next.js dashboard, a lightweight tracker.js, and Supabase for storage and realtime. Events are sent directly from the browser — no dedicated ingest server required.
What you get
- Landing page — product overview at
/ - Dashboard — manage websites, view stats, copy embed code at
/app - Per-site analytics — visitors, visits, pageviews, bounce rate, visit time, breakdowns (channels, pages, geo, device, browser, UTM)
- Realtime — 3D globe and live visitor list at
/app/[siteId]/realtime - Tracker — pageviews, page leave, custom events, SPA navigation, UTM capture, bot filtering
Architecture
Open Analytics uses two Supabase roles:
- Registry project (configured in
.env.local) — stores the list of websites, each site'ssite_key, and credentials to that site's data project. - Per-website project — one Supabase project per tracked site. Run
supabase/schema-analytics.sqlon your project; alleventsfor that site live in this database.
When you add a website in the dashboard, the app verifies it can readeventson your project and saves a row in appprojectswith your Supabase URL, publishable key, and an auto-generatedsite_keyfor the tracker.
Data flow
- Visitor loads a page with
tracker.js. - Tracker builds a fingerprint-based
visitor_id, session/visit IDs, parses device/browser/UTM, optionally fetches geo (cached). - Events are inserted into the site's Supabase
eventstable (or POSTed to a customdata-endpoint). - The dashboard reads events from the site project and aggregates metrics in the Next.js app. Realtime uses Supabase Realtime on
events.
Documentation sections
- Installation — Run the dashboard locally
- Sign-in setup — Google & GitHub OAuth
- Supabase setup — Registry and per-site projects
- Tracking script — Embed, options, and API
- Metrics — How numbers are calculated
- Dashboard — Stats, breakdowns, realtime
- Security — Production hardening
Quick start
- Follow Installation to run the dashboard.
- Complete Supabase setup (
schema-app.sql+schema-analytics.sql) projects. - Add a website in the dashboard and paste the snippet from Tracking script.
- Open Metrics to understand reported numbers.