Decide what to measure and build a metrics dashboard
@slashclone/product-analytics
Figure out what to measure in your web app and build a staff-only metrics dashboard for activation, retention, and funnels. You pick a few numbers per stage, write how each is counted, and compute most from tables you already have, so user data stays on your servers. Adds an audit log with no user content and loads any browser analytics only after consent.
SkillDevOpsv0.1.1 (latest)
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1# Metrics
- 3What we measure, how each number is counted, and what it is for. Change a definition here first, then the code.
- 5## Rules for every metric
- 7- **Excluded accounts:** house, staff, test, and seed accounts. Source of truth: (where the flag or list lives).
- 8- **Owner actions:** an owner's actions on their own items do not count as demand.
- 9- **Time zone:** UTC days unless stated.
- 10- **Code:** one function per metric in (path). Pages and jobs call it; nothing re-counts.
- 12## Stage: (name, for example Early)
- 14### (Metric name, for example Activation)
- 16- **Answers:** (the question, for example "Do new accounts reach the core action?")
- 17- **Rule:** (exact counting rule, for example "accounts created in the window that did X within 1 day, divided by accounts created in the window")
- 18- **Source:** (tables or events)
- 19- **Excludes:** (beyond the global rules, if any)
- 20- **Window:** (for example rolling 7 days, weekly cohort)
- 21- **Decision it informs:** (what we change if it moves)
- 22- **Known gaps:** (what the number cannot see)
- 24### Kept after N days
- 26- **Answers:** Is the thing still in use after N days?
- 27- **Rule:** kept when `last seen >= created + N days`.
- 28- **Signals that refresh last seen:** (for example a daily client ping, an update check, a sign-in)
- 29- **Source:** (table)
- 30- **Known gaps:** (for example clients that never ping)
- 32## Funnels
- 34| Funnel | Steps | Window per step | Source |
- 35| ------ | ------------------------ | -------------------- | -------- |
- 36| (name) | (step 1, step 2, step 3) | (for example 7 days) | (tables) |
- 38## Audit log kinds
- 40| Kind | Actor | Subject | Metadata kept |
- 41| --------------------------------- | ---------- | ------- | ------------- |
- 42| (for example `account.signed_in`) | account id | none | (method) |
- 44## Client tools
- 46| Tool category | Env var | Loads when | What it sends |
- 47| ----------------- | ------- | ----------------------- | ------------------------------------------- |
- 48| Product analytics | (name) | after Analytics consent | origin and path, internal id |
- 49| Error reporting | (name) | when set | scrubbed errors, no bodies or query strings |
