Custom events
Pageviews tell you where people go. Custom events tell you what they do. Track any action with a name and properties, then slice it in the Events view.
Sending an event
Call track with an event name and optional properties:
import { track } from "@analyse.net/sdk";
track("plan_selected", {
plan: "pro",
billing_interval: "month",
});With the script tag install, the same call is available on the global object:
Analyse.track("plan_selected", { plan: "pro" });Events show up in the Events view within seconds, and you can chart them, break them down by property, and use them in funnels and boards.
Naming events
A few habits that pay off later:
- Use
snake_casenames likereport_exported, not "Report Exported!". - Name the action, not the page.
signup_completedsurvives a redesign,clicked_green_buttondoes not. - Keep the name stable and put the variation in properties. One
plan_selectedevent with aplanproperty beats three separate events.
Properties
Properties are a flat set of values describing the event. Strings, numbers, and booleans all work. Amounts are best sent in minor units (cents) so they aggregate cleanly.
Do not put personal data like emails or names in event properties. If you need to know who did something, call identify and let Analyse connect the event to the person.
Standard events
For common lifecycle moments, signups, checkouts, and trials, the SDK ships typed helpers with agreed property shapes. Prefer those over hand rolled names, the dashboard understands them. See Standard events.