You can't improve what you can't see, and you can't trust data that was tracked carelessly. This skill writes a small tracking plan tied to the questions the team needs answered, implements it with the project's existing tools and conventions, and checks that it works.
Search the codebase for the tracking layer: SDK calls (posthog.capture, amplitude.track, analytics.track, mixpanel.track, gtag('event', rudderanalytics.track, Snowplow trackers), server-side SDKs, and above all the project's own wrapper (a track() helper, a useAnalytics hook, an events.ts file). If there's a wrapper, always go through it.
Read 10 to 20 existing events to learn the conventions: naming style (Invoice Sent, invoice_sent, invoice:sent), standard properties, how user and account identity are set (identify, group), and where events are typed or documented.
If the project has no analytics at all, stop and ask which tool to use. Adding a tracking vendor is a product, legal and privacy decision.
List the questions the data must answer, from brief.md, adoption-plan.md and experiment.md in the feature folder (docs/product/<feature-slug>/) when they exist:
Every event must answer at least one question. "Track everything" produces a lot of data and few answers.
| Event | Fires when (exact trigger) | Where in code | Properties | Answers |
|---|---|---|---|---|
Invoice Creation Started | User opens the new-invoice form | InvoiceForm.tsx, once per visit | entry_point, client_count | Tried; entry-point split |
Invoice Sent | Server confirms the invoice was sent | invoices.service.ts, after send succeeds | amount_bucket, currency, is_first_invoice | Value moment (activation) |
Invoice Send Failed | Send rejected | same, error branch | error_code, step | Drop-offs |
Rules:
Object Action in the past tense (Invoice Sent), Title Case, with the noun the product UI uses.entry_point, plan, variant, platform. Prefer enums and buckets to free text.Add events through the project's wrapper, with types if the project types its events (extend the event union or schema). Put UI events in event handlers or in effects that run once per occurrence — never in render bodies, where re-renders and development double-mounts duplicate them. Put server events after the operation commits, not before.
If an experiment is running or planned, log exposure when the user actually sees the variant, not when the flag is evaluated at app start. Many flag SDKs log exposure automatically on evaluation; check before adding a duplicate.
Trigger each event and confirm it fires once, with the right properties and identity:
Write funnel and metric definitions precise enough to build in the tool: steps, conversion window, counting unit (users or accounts), and filters (eligible users only). If the analytics tool is reachable from your environment (an API, a CLI or a connected integration), offer to create the funnel and dashboard; otherwise give the exact configuration.
Write tracking-plan.md to the feature folder (the table, funnel definitions and verification notes), along with the code changes. Summarize: events added, how each was verified, and the questions the data still can't answer.