Pug
Open-source product analytics with unified profiles
Replaces —

Who it's for
Track signups, feature adoption, and churn by building funnel and retention insights from server-side and web events, then pin them to a shared dashboard. Use `identify()` with plan traits to filter every chart by subscription tier.
Instrument an Android or Flutter app with autocaptured screen views and lifecycle events, then use user flow analysis to see where people leave and funnel analysis to measure checkout conversion.
If the app has no need for unified cross-platform identity or server-side events.
Deploy Pug on your own servers in your preferred region under AGPL-3.0, use the cookieless default, and satisfy GDPR data subject requests with the hard-delete erasure API, keeping all event data inside your infrastructure.
If the team is comfortable with a third-party cloud and has no data residency requirement.
Connect the Pug MCP server to Claude or Cursor, then query in natural language: which signup source converted best last week, or what one customer did before they churned. The MCP server can also create dashboards from the conversation.
If the team does not use an MCP-compatible AI assistant.
The problem
Product teams need to understand what users do across web, mobile, and server touchpoints, but most analytics tools store data on third-party servers, charge per seat or project, require manual event wiring for basic metrics, and make it hard to connect anonymous behavior to known users. Privacy regulations add further pressure around cookies and data subject erasure.
How it works
Trends, funnels, retention cohorts, segmentation, user flow (Sankey), and top-K breakdowns. Every insight supports filtering and breakdown by any property sent with the event, with no advance configuration required.
Each person gets one profile. Anonymous pre-sign-in events merge into it on `identify()`. The same user ID sent from web, Android, and your server resolves to a single person, with traits such as plan or email available to filter every insight.
The web SDK automatically captures page views, clicks, scrolls, form submits, and rage clicks from `init()`. Android and Flutter SDKs autocapture app lifecycle events, screen views, installs, and updates.
Sixteen tools let Claude, ChatGPT, Cursor, or any MCP client query your insights, events, sessions, and profiles, and build or edit dashboards. The server queries the same API you do, so its numbers match yours. It cannot erase people, send events, or delete dashboards.
Until a visitor consents, Pug counts them with a server-side hash. The salt is deleted every day, not rotated, so today's visitors cannot be linked to yesterday's. Consent states (granted, cookieless, or denied) wire to your existing banner.
One API call hard-deletes a person by profile ID or your own user ID. Their events, sessions, aliases, and profile are removed from both ClickHouse and PostgreSQL, and a request ID confirms when the deletion is complete.
Features
- Six insight types
- Unified user profiles
- Autocapture
- MCP server
- Cookieless by default
- GDPR erasure
How to install
# Build the binary make build # Start dev infrastructure (PostgreSQL, NATS, ClickHouse) make infra # Run migrations ./bin/pug migrate # Seed demo data ./bin/pug seed # Start the dev server and workers ./bin/pug dev
Recommended for this setup
Strengths
- Full self-hosting, no event cap: The self-hosted path runs the same open-source code under AGPL-3.0 with no event limit beyond your hardware. Container images are published for amd64 and arm64. `pug start` runs the server and every worker in one process for a small node, or each role can be its own image in production.
- No per-seat or per-project fees: Pug Cloud pricing is based on events alone. SSO with Okta, Entra ID, and Google Workspace is included on every plan, including the free tier. There are no charges for additional team members or additional projects.
- SDKs for six platforms: Official SDKs are available for web (npm), Android (Gradle), Flutter (pub), Node.js, Go, and Ruby. Each SDK supports `track()` and `identify()`, and server SDKs expose a profile read API using the same private key.
- EU-hosted cloud with strong privacy defaults: Pug Cloud runs in the EU. The cookieless default, daily salt deletion, and hard-delete erasure API are designed for GDPR and India's DPDP requirements without requiring a separate privacy layer.
Trade-offs
- AGPL-3.0 license: Self-hosting Pug is free, but the AGPL-3.0 license requires that modifications and applications incorporating Pug be released under the same terms. Teams embedding Pug in a proprietary product need to review this carefully or use Pug Cloud.
- Infrastructure dependencies for self-hosting: A self-hosted instance requires PostgreSQL 15 or later, ClickHouse, NATS JetStream, and either Dragonfly or Redis 7 for the daily salt. This is a heavier operational footprint than single-binary analytics tools.
- New project: Pug is an early-stage project. The Go SDK, for example, launched recently. Teams that need a large ecosystem of integrations, a long track record, or enterprise support contracts should evaluate maturity against their requirements.
Tech stack
FAQ
Pug Cloud is free up to 100,000 events per month, with one year of history, SSO, and no credit card required. Past that limit, pricing starts at $1 per month base fee plus per-event rates that decrease at higher volumes.
Yes. Pug is free to self-host forever under AGPL-3.0 with no event limit. Support is available on GitHub and Discord. A self-hosted instance requires PostgreSQL 15 or later, ClickHouse, NATS JetStream, and Dragonfly or Redis 7.
Before sign-in, events are collected under an anonymous ID. Calling `identify()` at sign-in merges that anonymous history into the person's profile. Sending the same user ID from the web SDK, Android SDK, and a server SDK results in one unified profile.
No, not by default. Until a visitor explicitly consents, Pug uses a server-side hash to count them. The hash salt is deleted every day rather than rotated, so it is not possible to link today's visitors to yesterday's. You can wire your existing consent banner to three states: granted, cookieless, or denied.
Pug Cloud exposes an MCP server at `https://api.pug.sh/mcp`. Add Pug from Claude's connectors directory, or add the endpoint as a custom connector in Claude Code, Codex, Cursor, or any other MCP client. For a self-hosted instance, the endpoint is `/mcp` on your API host.