# Event tracking with open source analytics

A practical guide to event tracking with open source analytics: autocapture vs manual events, properties and identity, building a tracking plan, and owning your data.

Source: https://pug.sh/learn/event-tracking-open-source

Events are the foundation of product analytics. Here’s how event tracking works, the autocapture-plus-manual approach, why a tracking plan matters, and how open source keeps the data yours.

By [Praveen Kumar](https://github.com/poluruprvn), who builds Pug. Published June 13, 2026

## Events are the raw material

Every funnel, retention chart, and user flow is built from **events**: discrete actions like a page view, a click, or a custom `signup`. An event carries **properties** (which plan, which page, how much) and is tied to a **person**. Get event tracking right and the reports take care of themselves; get it wrong and no dashboard can save you.

## Autocapture plus manual events

The pragmatic approach combines two modes. **Autocapture** records common interactions (page views, clicks, scrolls, form submits, and frustration signals like rage and dead clicks) automatically after one `init()`. That gives you data on day one. Then you add a small number of **manual** `track()` calls for the domain events that carry real business meaning: `signup`, `checkout_started`, `subscription_started`. You get breadth for free and depth where it counts.

## Tie events to people

An event is far more useful when it belongs to a person. Before sign-in, events accrue to an anonymous ID; calling `identify(userId)` merges that history into one profile. On the web that needs consent: in cookieless mode, the SDK’s default, `identify()` does nothing. From then on, traits like plan or email filter every report, and you can follow a single user across sessions and devices. This identity model is the heart of [product analytics](https://pug.sh/learn/open-source-product-analytics).

## Write a tracking plan

Consistency is what separates useful event data from noise. A **tracking plan** is an agreed list of event names and their properties, so the whole team sends `checkout_started` instead of a mix of `CheckoutStart`, `begin_checkout`, and `checkout`. Decide names up front, keep properties consistent, and flag anything that carries personal data. If it helps, our [event tracking plan generator](https://pug.sh/tools/event-tracking-plan-generator) produces a starter plan from well-known events you can export and adapt.

## Why open source

Event data is a precise record of user behavior, which is exactly why where it lives matters. Open-source event tracking lets you [self-host](https://pug.sh/self-hosted-analytics) so events stay in your own database, read the code to see how they’re processed, and avoid per-event pricing as you scale. For developers, the [developer guide](https://pug.sh/blog/product-analytics-for-developers) covers the SDKs and API that make this concrete.

## Common questions

### What is event tracking?

Event tracking records discrete user actions (a page view, a click, a custom action like signup or purchase), usually with properties (which plan, which page) and tied to a person. Those events are the raw material every product-analytics report is built from.

### Autocapture or manual events?

Both. Autocapture records common interactions (page views, clicks, scrolls, form submits) automatically, so you start with data immediately. You add manual track() calls for domain-specific events that carry business meaning, like checkout_started.

### Do I need a tracking plan?

For anything beyond the basics, yes. A tracking plan is a shared list of event names and properties so your data stays consistent. Even a simple, well-named set of events prevents the “three names for the same thing” mess.

### Why use open source for event tracking?

Events are a detailed behavioral record. Open source lets you self-host so they stay on your servers, audit how they’re processed, and avoid per-event SaaS pricing as volume grows.
