Guide

The complete guide to open source analytics

Open source analytics is software whose code you can read and run on your own servers, so the events stay with you. This guide covers its two kinds, web and product, the main tools, and how to choose and run one.

Web vs product analytics Tools compared Self-hosting
Definition

What “open source analytics” means

Analytics software released under a license you can read, modify, and run yourself.

In practice that means ownership: instead of sending every event to a vendor’s cloud, you run the tool and keep the data on your own infrastructure. The category covers two different jobs (web analytics and product analytics), so start by knowing which one you need.

Why it matters

Why teams choose it

Data on your servers

Events are written to a database you run, and stay there. Nothing is sent to the vendor.

Privacy and compliance

Self-hosting simplifies data residency and GDPR; see privacy-first analytics.

Cost control

No per-event bill when you run it yourself; see free analytics for startups.

No lock-in

The license lets you read and change the code, and the raw events sit in a database you control.

The big distinction

Web analytics vs product analytics

The two get confused more than anything else here. Most teams run both, for different jobs.

Traffic

Web analytics

Measures traffic, pageviews, sources, devices, locations. The right tool for marketing and content.

Behavior

Product analytics

Measures behavior inside your product (funnels, retention, user flows), tied to a person over time.

How to choose

Three questions, in order

1

Pick the question

Traffic and marketing? That’s web analytics. Product behavior, funnels, retention, flows? That’s product analytics.

2

Weigh the operating cost

Lightweight web tools are easy to run; product analytics tools range from a single binary to a multi-service stack. Count the services your team will run.

3

Confirm data ownership

Check that you can self-host it and read your raw events back out. Replacing GA specifically? The free GA replacement guide maps the migration.

Running it yourself

Running Pug yourself

Pug’s whole stack is one Go binary backed by PostgreSQL, ClickHouse, and NATS.

Getting started

Start with a few events

On the web, Pug records page views, clicks, and scrolls as soon as you call init().

Then add the events specific to your product with event tracking and a small tracking plan. Self-host for free, or start on Pug Cloud (free up to 100k events a month), which runs the same code.

FAQ

Common questions

What is open source analytics?

Analytics software released under an open license you can read, modify, and self-host, so you can run it on your own infrastructure and keep your data, rather than sending it to a vendor’s cloud. It spans both web analytics (traffic) and product analytics (behavior).

Is open source analytics free?

Self-hosting has no license cost; you provide the infrastructure. Many open source tools also sell a managed cloud, which is where they charge. There’s no per-event bill when you run it yourself.

Do open source analytics tools include SSO?

Often not in the free edition. A self-hosted PostHog needs an enterprise license for SAML or OIDC, Plausible’s Community Edition leaves SSO out, and Matomo sells SAML sign-in as a premium plugin. Pug’s SSO (Google Workspace, or an OIDC provider such as Okta or Microsoft Entra ID) is part of its free AGPL-3.0 build.

Is open source analytics good for privacy and GDPR?

It can be a strong foundation: self-hosting keeps data on your own servers, which simplifies data-residency and GDPR questions. It isn’t automatic compliance, but it removes the third-party data sharing that complicates many setups.

What’s the best open source analytics tool?

There’s no single best. It depends on whether you need web analytics or product analytics, and how much you’re willing to operate. The tools roundup and the comparison pages walk through the strongest options for each need.

Can open source analytics replace Google Analytics?

Yes. Matomo is a direct web-analytics replacement; for product behavior, tools like Pug and PostHog cover funnels, retention, and profiles. The usual motivation is owning your data instead of handing it to Google.

Send your first event.

Create a project, add the snippet, and watch the Live view fill up. Or open the demo first: the real dashboard on a sample pet shop, with no sign-up.

Questions? Email hello@pug.sh