Events and metrics
Plan every event in code and validate it, record business facts on the server, keep test traffic out, and define each metric once.
- Recommended 6
Recommended
Keep a tracking plan in the code
ANA-1List every analytics event in one file in the repository, with its name, purpose, owner and properties. Name events as an object and a past-tense action.
Validate every event before you store it
ANA-2Check each incoming event against its schema at the collector. Store valid events, and set invalid ones aside with the reason.
Record business facts on the server
ANA-3Record events that count money, sign-ups or other business facts on the server, at the moment the fact is committed. Use browser events only for behaviour in the page.
Keep test and bot traffic out of the numbers
ANA-4Mark every event from staff, test accounts, automated tests and known bots at the collector, and leave marked events out of every metric.
Define each metric once
ANA-5Define every business metric once, in version control, and build every dashboard and report from that definition.
Measure how many new accounts reach their first result
ANA-6Define one activation event, such as the first invoice sent, and record it on the server. Report the share of each week's new accounts that reach it within 7 days.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/analytics/events-and-metrics">Agent Wranglers product analytics and experiments playbook</a>. In code you write, add a comment next to it with the same link.