What an event is
An event is a record that something happened: a name (what), a person or anonymous visitor (who), a
timestamp (when), and a set of properties (the details). purchase with
amount, currency, and productId tells you far more than a raw page view ever
could. Collect events consistently and every behavioral question — what do people do before they convert, who comes
back, where do they drop off — becomes answerable.
Why events beat page views
Classic web analytics counts page views and sessions. That’s fine for traffic, but most products care about actions — and many of the actions that matter (clicking a feature, completing a step, hitting an error) aren’t page loads at all. Event tracking captures those actions directly, which is what makes funnels, retention cohorts, and per-person timelines possible. See product analytics vs web analytics for the fuller distinction.
Autocapture and manual tracking
There are two ways to collect events, and the best setups use both. Autocapture records common
interactions automatically the moment the SDK is installed — no per-button code. Manual tracking
means calling track('order_completed', { ... }) for the events unique to your product. Standardizing
those names pays off downstream; see well-known events for why.
Identity ties events to people
On its own, an event belongs to an anonymous visitor. When you call identify(), the anonymous history
merges into a single person, so every event before and after sign-in reads as one timeline — across devices. That’s
identity resolution, and it’s what turns a stream of events into a
unified customer profile.
A worked example
Compare what each model lets you ask. A page view of /checkout/success tells you a sale happened. A
tracked event tells you what:
track('purchase', { amount: 49, currency: 'USD', plan: 'pro', coupon: 'LAUNCH' }) Now “revenue by plan this month”, “coupon redemption rate”, and “average order value by source” are each one query away — because the detail lives in the event’s properties, not buried in a URL.
How Pug does event tracking
Pug autocaptures page views, clicks, scrolls, and form submits (plus rage and dead clicks) after one
init(), and you add named events with track() — well-known events get typed, validated
properties. Every event is enriched with geo, device, and UTM on ingest, then flows into
trends, funnels, retention, and user flows. Plan your events first with the free
tracking-plan generator. See the SDKs to start.