# Open Analytics

> Privacy-first, cookieless web analytics with realtime dashboards, revenue attribution, AI chat, and an MCP server — open source and self-hostable under AGPL-3.0.

Open Analytics is an open-source, privacy-first web analytics platform built by OpenLabs. It tracks visitors from first pageview to payment without cookies, consent banners, or personal data collection, and ships with an MCP server so AI agents can query your analytics directly. The core product is publicly available on GitHub under AGPL-3.0, and a hosted cloud instance runs at getopen.so.

## What It Is

Open Analytics sits in the privacy-first web analytics category alongside tools like Plausible and Fathom, but differentiates itself with built-in revenue attribution, an AI chat interface, and a native MCP server. Visitors are identified with a daily-rotating salted hash — no cookies, no fingerprinting, no cross-site profiles. The tracker is a single async script tag of around 2 KB compressed, installable with one `npx getopen init` command or a plain script tag, with no SDK and no build-step changes required.

## Architecture and Stack

The repository is a pnpm monorepo with ten distinct apps and several shared packages:

- **Tracker** — the browser snippet with a CI-enforced byte budget
- **Collector** — validates, sanitizes, rate-limits, and enqueues events
- **Worker** — drains the queue into ClickHouse; handles sessions, rollups, exports, and email
- **API** — control plane covering auth, sites, keys, funnels, revenue, AI assistant, and MCP
- **Query Gateway** — the only process allowed to read ClickHouse; verifies Ed25519-signed query envelopes
- **Realtime** — the SSE stream behind the live dashboard
- **Web** — the Next.js dashboard
- **CLI** — the `oa` command for site setup, stats, and device-flow login

Storage uses Postgres for the control plane, ClickHouse for events and rollups, and two Valkey instances (one durable event queue, one losable realtime cache). The frontend may only import the OpenAPI contracts package, making the API document the single seam between frontend and backend.

## AI-Native Features

The "AI-native" positioning centers on two surfaces. First, an in-dashboard AI chat lets users ask plain-English questions ("Which page brings the most signups?") and receive direct answers rather than reports. Second, an MCP server exposes the read API to AI agents over the Model Context Protocol, with OAuth-based authentication and revocable access. The comparison table on the homepage notes that as of the time of writing, Plausible and Fathom offer no MCP server, while GA4 offers only a self-run official server.

## Self-Hosting Path

Self-hosting requires a Linux host with Docker, four DNS records, approximately 4 GB of RAM, and 25 GB of free disk. A release publishes ten container images to `ghcr.io/openlabs-so/openanalytics`, so installation is a pull rather than a build. The setup flow is: clone the repo, check out the latest release tag, run `./generate-secrets.sh`, then `docker compose pull && docker compose up -d`. An `upgrade.sh` script handles version moves and takes the snapshot that `rollback.sh` needs, with an explicit warning that migrations do not go down.

## Update: v0.4.2

The latest release is v0.4.2, published on 2026-08-15. The GitHub repository was created on 2026-08-11 and last pushed on 2026-08-18, indicating rapid early development. The README notes that prior to August 2026 the repository received periodic exports from a private monorepo; direct pull-request contributions began with the public repository. The project has accumulated 238 stars and 21 forks in its first week of public availability.

## Integrations and Revenue Attribution

Revenue attribution connects to Stripe via a restricted read-only key, linking each payment to the visit, page, channel, and campaign that produced it. Additional payment processors shown in the UI include Lemon Squeezy, Polar, Paddle, Creem, and Dodo. History imports are supported from Plausible, Fathom, and Google Analytics via ZIP upload with a one-click rollback. Weekly digest emails and public read-only dashboard sharing (no account required) are included on all plans.

## Features
- Cookieless tracking — no consent banner required
- Realtime dashboard with live visitor globe
- Revenue attribution linked to pages, channels, and campaigns
- AI chat interface for plain-English analytics queries
- MCP server for AI agent access
- Funnels and conversion tracking
- Core Web Vitals (LCP, INP, CLS, TTFB) on real visits
- Visitor journey replay (anonymous, session-scoped)
- Custom events with value breakdowns
- Campaigns and UTM tracking
- Public read-only dashboard sharing
- Team roles (owner, admin, viewer) with no per-seat charge
- History import from Plausible, Fathom, and Google Analytics
- Weekly digest email reports
- Self-hostable via Docker Compose
- CLI tool for site setup and stats
- Read API with Bearer key and OAuth support
- GDPR compliant — no personal data stored
- Do Not Track and Global Privacy Control honored at collector
- ClickHouse-backed queries for fast historical reads

## Integrations
Stripe, Lemon Squeezy, Polar, Paddle, Creem, Dodo, Plausible (import), Fathom (import), Google Analytics (import), Next.js, WordPress, Webflow, Shopify

## Platforms
MACOS, LINUX, WEB, API, CLI

## Pricing
Open Source, Free tier available

## Version
v0.4.2

## Links
- Website: https://getopen.so
- Documentation: https://getopen.so/docs
- Repository: https://github.com/OpenLabs-so/openanalytics
- EveryDev.ai: https://www.everydev.ai/tools/open-analytics
