Every chart in product analytics is built from events: a named thing a person did, with a timestamp and a few properties. A funnel is a sequence of events. A path is the order they happened in.
Two early habits cause a lot of tracking problems: tracking everything, and naming things as they come up. This guide is the plan to write before the first track() call.
Key takeaways
- Write the questions first. An event that answers no question is noise.
- About ten events are enough to answer the first questions about signup, activation and revenue.
- Name events
object_verbin lowercase, past tense. Renaming one later splits its history. - Send an event from where the thing happens. Signups and payments happen on the server.
- Identify the user and the account on every event, so one person is counted once.
Start from questions
A tracking plan is a list of events, and for each one its name, when it fires, where it is sent from and which properties it carries. The way to keep that list short is to write down the questions it has to answer and work backwards.
For a typical SaaS product the first questions are these:
- Acquisition. Of the people who start signing up, how many finish? Which channel sends the ones who do?
- Activation. How many new accounts reach the first moment the product is useful, and how long does it take?
- Retention. Which actions do the accounts that stay perform in their first week?
- Revenue. How many activated accounts start a paid plan, and which plan?
Each question names the events it needs. "How many finish signing up" needs a start and a finish. "Reach the first useful moment" needs you to decide what that moment is, which is a product decision more than a tracking one.
Ten events to start with
This is a starting plan for a B2B SaaS product. The names come from an analytics product, the one the screenshots in this series show. Swap the middle rows for the actions that matter in yours. The first two and the last three apply almost everywhere.
| Event | Fires when | Sent from | Properties |
|---|---|---|---|
signup_started | The signup form is opened | Browser | method |
signup_completed | The account exists in your database | Server | method |
workspace_created | The first workspace or project is created | Server | template |
onboarding_connected | The product receives its first real data | Server | kind |
dashboard_created | The user makes the thing your product is for | Server | type |
dashboard_shared | They show it to someone else | Browser | channel |
invite_sent | A teammate is invited | Server | role |
checkout_started | The upgrade dialog opens | Browser | plan, interval |
plan_started | The billing provider confirms the subscription | Server | plan, seats, interval |
plan_cancelled | The subscription ends | Server | plan, reason |
Page views are not in the table because a browser SDK records them for you. Do not add events for every button. A click that matters shows up as the event it causes: nobody needs upgrade_button_clicked when checkout_started exists.
The plan covers signup, activation and revenue. For retention, make sure the one or two actions a healthy account repeats every week are events too. In this plan that is dashboard_created. The later parts of the series also use a few events added after this first plan, such as onboarding_viewed, docs_opened and query_run.
Naming rules
The event name is the key every funnel step, chart and filter uses. Three rules keep names usable:
- One form. Lowercase snake_case, an object then a past-tense verb:
invite_sent,plan_started. Mixed forms (Signup Complete,signupDone,completed_signup) become three events that mean the same thing. - Name the fact, not the interface.
plan_startedsurvives a redesign.pricing_modal_green_button_clickeddoes not. - Never put a value in the name.
plan_started_proandplan_started_teamshould be one event with aplanproperty. Values in names multiply events and make "all plans" impossible to count.
Renaming is expensive
Stored events keep the name they were sent with. After a rename, charts show the old name ending and a new one starting, and every funnel that used the old name stops matching new data. Treat names like a public API: review them before they ship.
Properties
A property is a detail of one occurrence: the plan chosen, the signup method, the number of seats. Properties are what you filter and break down by later, so add the ones your questions name and stop there.
- Use the same property name for the same thing on every event.
planeverywhere, neverplanon one event andtieron another. - Keep values to a small fixed set where you can:
google,github,email. Free text cannot be grouped. - Leave out personal data you do not need. An event rarely needs an email address when it already has a user id.
Properties of the person or the account are different from properties of the event. The plan chosen at one checkout belongs on the event. The plan an account is on today belongs on the account. The B2B guide covers when to use which.
Visitor, user, account
An event is only useful for funnels if the tool can tell that two events came from the same person. Three ids do that work:
| Id | What it is | Set by |
|---|---|---|
| Visitor id | An anonymous id for a browser or a mobile install | The browser SDK, or your app for an install id |
| User id | Your own id for a signed-in user | Your code, at sign-in |
| Group id | The account, workspace or organization | Your code, with the user |
The signup funnel crosses the sign-in boundary: signup_started comes from an anonymous visitor and plan_started from a known user. Call identify() as soon as the user is known, and send the same user id from your backend. Maple links a visitor to the user it becomes, so the anonymous visit and the signed-in activity count as one person.
Use the id from your database, not an email address. Emails change, and two people can share one.
Client or server
Send an event from the place where the thing happens. A page view or the opening of a dialog happens in the browser. An account being created or a payment succeeding happens on the server, and only the server knows it succeeded.
Browser events are lost to ad blockers, closed tabs and failed requests. That is acceptable for checkout_started and not for plan_started. If a number will be compared with revenue, send it from the backend.
Send the events
Maple accepts product events from three places. All three carry the same user, group and visitor ids, so one funnel can mix them.
From the browser
The browser SDK records page views on its own. Custom events are one call:
app.ts
import { MapleBrowser } from "@maple-dev/browser"
MapleBrowser.init({ ingestKey: "maple_pk_...", serviceName: "acme-web" })
// Once the user is known. Before this, events carry the anonymous visitor id.
MapleBrowser.identify({ id: user.id, groupId: org.id, groupName: org.name })
MapleBrowser.track("checkout_started", { plan: "pro", interval: "year" }) From a span you already emit
If the backend is traced with OpenTelemetry, the handler that starts a plan already produces a span. One attribute turns that span into a product event, linked to the trace that did the work:
billing.ts
// Inside the handler that creates the subscription.
span.setAttributes({
"maple.product_event.name": "plan_started",
"maple.product_event.user_id": user.id,
"maple.product_event.group_id": org.id,
"maple.product_event.include": "plan,seats,interval",
plan: "pro",
seats: 12,
interval: "year",
})
Without maple.product_event.include, every attribute on the span becomes an event property. See product events from traces.
Over HTTP
Anything that can make an HTTP request can post events: a webhook handler, a batch job, a mobile app. The body is one JSON object per line.
curl -X POST https://ingest.maple.dev/v1/events \
-H "Authorization: Bearer YOUR_INGEST_KEY" \
-H "Content-Type: application/x-ndjson" \
--data-binary $'{"name":"plan_started","user_id":"user_123","group_id":"org_456","attributes":{"plan":"pro","seats":12}}\n' The events API reference lists every field and limit.
Check what arrives
Trigger each event once in a test account, then read the list. In Maple, Product analytics opens on the Events tab: every event name in the time range, its kind, and how many events, sessions and people it has.
Three things to look for:
- Names you did not plan. A typo or a second naming form shows up as its own row.
- People lower than expected. If
plan_startedhas events and no people, the server is not sending a user id. - Events far above people. An event that fires in a render loop or on every keystroke has thousands of events per person.
Common mistakes
- Tracking the click instead of the outcome. A click on "Create account" is an attempt. Send
signup_completedwhen the account exists. - Different ids in the browser and the backend. If the browser identifies by email and the server sends a database id, every person is counted twice and no funnel crosses the two.
- Events before identify. Call
identify()when the session is restored on page load, not only at sign-in. - Changing what an event means. If
dashboard_createdstarts firing for drafts too, the chart jumps and nobody remembers why. Add a new event instead. - Test traffic in the numbers. Keep development and staging out of production data, and decide how to exclude your own team before reading a conversion rate.
- No owner. Keep the plan in the repository next to the code that sends the events, and change it in the same pull request.
Coming from PostHog
The model is the same: named events, properties, an anonymous id that merges into a user at identify. The calls map like this:
| PostHog | Maple |
|---|---|
posthog.capture(name, props) | MapleBrowser.track(name, props) |
posthog.identify(id, props) | MapleBrowser.identify() with id and traits |
posthog.group(type, key) | groupId in identify(), group_id on server events |
$set and $set_once | set and set_once on the events API |
$pageview | Recorded by the browser SDK |
| Autocapture | No equivalent. Clicks appear in session replay, and events are explicit calls. |
A few differences to plan for. Maple has one group id per event where PostHog allows several group types. And Maple does not turn clicks into events on its own, so an event plan like the one above is required from day one. PostHog also bundles feature flags, experiments and surveys, which Maple does not have. Mobile apps send events to Maple through the HTTP API.
Maple
Product events next to your traces
Maple stores product events for 365 days beside the traces, logs and session replays of the same users. A funnel step that comes from a traced request links back to the request behind it.