tracking-standards
At a glance
Mode. Standalone designs or reviews the requested taxonomy or metric from supplied flows and existing instrumentation; a plan authorizes no implementation, analytics configuration or publishing. Inside phases 4 to 7 the plan feeds the gate that calls it. Both per operating modes. Designing or reading an experiment (A/B test, fake door, sample size, duration, guardrails) is the experiments mode: follow experiments, with its own markers. Read the requested query shape in the analytics contract for measurement design, and the section of tracking conventions for names, properties, identity fields or tracking location in a new schema, plus its QA checklist before shipping any tracking.
- 1Understand the feature
- 2Read what already exists
- 3Design the taxonomy
- 4Design the funnels
- 5Specify the dashboard
- 6Write the implementation checklist
The skill
A tracking plan starts from the question a number answers and works back to the events that compute it. Every event has a question it answers; shipped names are preserved, because funnels and dashboards already depend on them.
Mode. Standalone designs or reviews the requested taxonomy or metric from supplied flows and existing instrumentation; a plan authorizes no implementation, analytics configuration or publishing. Inside phases 4 to 7 the plan feeds the gate that calls it. Both per operating modes. Designing or reading an experiment (A/B test, fake door, sample size, duration, guardrails) is the experiments mode: follow experiments, with its own markers. Read the requested query shape in the analytics contract for measurement design, and the section of tracking conventions for names, properties, identity fields or tracking location in a new schema, plus its QA checklist before shipping any tracking.
Procedure
Understand the feature from the spec where one exists, else from the code: entry points, states, success and failure paths, decision points. A description skips the error and abandonment states. Done when every state and path of the flow is listed.
Read what already exists. For each event already emitted in this area, its name, properties and volume:
- Exists and used: extend it with a property rather than adding a sibling event.
- No observed volume: confirm collection health, environment, eligibility and measurement window before calling it unused, since missing access or an empty export leaves volume unknown. Propose removal with evidence and within the requested scope.
- Nothing exists: design from scratch against the convention.
Without a catalogue, search the instrumentation: source records what is emitted, the catalogue what is received, and where both exist their difference is a finding. Done when every event in the area has one of the three verdicts.
Design the taxonomy. Keep the existing names, casing, separators, identity keys and property schemas; a rename or a sibling convention happens on an explicit migration request. The default conventions apply to new schema choices. Properties and identifiers come from what the identity model, consent rules and call site provide. Every event gets a name, a trigger, typed properties and the question it answers. Done when every event has all four.
Design the funnels. Order the events into the conversion paths that matter, each with its conversion window. Done when every funnel assembles from planned events alone.
Specify the dashboard in the artifact: analytics-contract shapes, events, breakdown properties; build it in a tool when the person asks and a provider resolved. Done when each metric the plan serves has its shape and events named.
Write the implementation checklist. Per event: where in the code it fires, which properties are available at that call site, how it will be verified. Done when every event has its call site and verification.
Watch for
| Do | Instead of |
|---|---|
Keep report_exported as shipped | Renaming it to Report Exported with no migration request, splitting funnels |
| The SDK's anonymous identity, or attribution documented as unavailable | A fake account_id for an anonymous visitor |
| Unknown kept unknown, with the measurement needed | Missing data filled with zero |
Capabilities
| Capability | Used for | Floor when absent |
|---|---|---|
analytics.events | The existing event catalogue and properties, so shipped events are extended | Search the repository for the analytics SDK's call sites and collect the literal event names |
analytics.query | Volume per existing event, to find the dead ones | Skip; design proceeds without it |
repo.read | The feature's actual states and transitions | Ask the person to walk through the flow |
files.read / files.write | The tracking plan itself | Always present |
A tracking plan needs no connected analytics, only an accurate picture of the feature and a naming convention held consistently.
Output Contract
## TRACKING PLAN COMPLETE, heading a report in the tracking plan template. Standalone output follows the requested format and destination, with no gate claims.
References
Read only when a step needs them, so they cost no context until then.
Tracking Conventionsreferences/conventions.md
Default naming, property, identity and placement conventions, and the QA checklist, for tracking-standards. Read only the section the current step needs. Every default here yields to an existing taxonomy.
Event Naming Convention
First preserve the existing taxonomy. Use its names, casing, separators, identity keys and property schemas for new events. Do not rename live events or introduce a sibling convention without an explicit migration request.
Default for a new taxonomy only: [Object] [Action], title-cased object and past-tense action, separated by a space. The table is an example convention, not a rule that replaces an established schema.
| Component | Rule | Good | Bad |
|---|---|---|---|
| Object | Noun, singular | Report | Reports, report, rpt |
| Action | Past tense verb | Created | Create, creation, new |
| Separator | Single space | Report Created | report_created, ReportCreated |
Standard Actions
| Action | When to Use |
|---|---|
Created | New entity instantiated |
Viewed | Entity rendered on screen |
Updated | Entity modified |
Deleted | Entity removed |
Started | Process initiated |
Completed | Process finished successfully |
Failed | Process ended in error |
Shared | Entity sent to another user |
Exported | Entity downloaded or sent externally |
Clicked | UI element interacted with (avoid if possible: prefer semantic events) |
Context Properties
Use the existing identity model, consent rules and properties available at the call site. The B2B authenticated examples below are conditional, not mandatory on every event. Anonymous flows may have only the SDK’s permitted anonymous/session identifier; never fabricate a user_id, account_id, plan or account age to fill a row. Omit unavailable identifiers or use documented null semantics, and describe how identified/anonymous events join when consent and the existing provider support it.
| Property | Type | Source | Purpose |
|---|---|---|---|
account_id | string | Backend | B2B group analytics |
user_id | string | Backend | Individual behavior |
plan | string | Backend | Plan segmentation |
account_age_days | integer | Calculated | Maturity analysis |
session_id | string | SDK | Session grouping |
Property Standards
Preserve existing property naming and types. The examples below are defaults for a new schema only.
| Rule | Good | Bad |
|---|---|---|
| Use snake_case | company_size | companySize, Company Size |
| Use enum values, not free text | plan: "pro" | plan: "Professional Plan" |
Boolean = is_ prefix | is_admin | admin, isAdmin |
Count = _count suffix | item_count | items, num_items |
Duration = _seconds or _ms suffix | load_time_ms | load_time |
Backend vs. Frontend Events
| Category | Tracking Location | Reason |
|---|---|---|
| Revenue events | Backend ONLY | Reliability, no client manipulation |
| Lifecycle events | Backend ONLY | Account creation, plan changes |
| Core actions | Backend preferred | Data integrity |
| UI interactions | Frontend | Only accessible client-side |
| Feature discovery | Frontend | Page/component visibility |
QA Checklist
Before shipping any tracking:
- Event names follow the existing taxonomy, or the explicitly selected convention for a new taxonomy
- Properties match the identity/consent contract; no fabricated IDs and no authenticated-only fields required on anonymous flows
- Property types match specification (string/number/boolean)
- No PII in event properties (no emails, names, IPs)
- Enum values use lowercase, consistent format
- Events tested in staging environment
- Funnel definitions verified against the resolved analytics provider
- B2B group attribution uses the existing permitted group key where available; anonymous events do not invent an account
More Common Mistakes
| Mistake | Why it fails | Correct |
|---|---|---|
| Requiring pipeline state for a scoped artifact | Expands the request | Use supplied inputs and the requested output destination |
Experiment Design Referencereferences/experiment-design.md
Read when writing the hypothesis, choosing metrics, specifying randomization and runtime, choosing an experiment type, or interpreting a borderline result. Calculations are in proportions.
Hypothesis Template
If we [specific, implementable change],
then [primary metric] will [increase/decrease] by [minimum detectable effect],
because [reasoning tied to user behavior or data].Bad hypothesis: "If we improve onboarding, activation will increase." Good hypothesis: "If we add a progress bar to the 3-step setup wizard, setup completion rate will increase by 8pp (from 45% to 53%), because users abandon when they don't know how many steps remain (exit survey data: 34% cite 'didn't know how long it would take')."
Metrics and statistical method
Use one preregistered primary outcome plus the minimum applicable input indicators and guardrails. More than one guardrail may be needed; exactly three total metrics is not a statistical requirement. Specify randomization unit (usually account for B2B), allocation, exposure, eligibility, analysis population and the business effect worth detecting.
For equal-allocation binary outcomes, use the normal approximation in references/proportions.md: Two-sided 95% confidence, 80% power, independent units. The zero-dependency scripts/proportions.mjs is the calculation source and generates the committed lookup table. Where local execution is unavailable, apply the same formula explicitly; the script is optional. Do not apply it to clustered users, repeated observations, multiple arms or rare-event regimes without an appropriate design.
Runtime is sample per arm × arms / daily eligible independent units, rounded up, then extended to the preregistered full business cycles. A short calculated runtime is not proof the MDE is wrong; it still needs a calendar rule. A long runtime is a design tradeoff, not permission to change assignment unit after seeing results.
Calculation example: At baseline 5%, an absolute +5pp means 10% alternative (100% relative lift): 432 per arm. A +10% relative lift means 5.5% alternative: 31,196 per arm. Label both scales; never call 10% relative lift 10pp.
Interpretation example: A completed fixed-horizon test with an interval from −2pp to +5pp remains inconclusive when +3pp is the business threshold. Neither “no effect” nor an unplanned “run until significant” follows. A confidence interval contained inside a preregistered equivalence margin can support an equivalence claim using the appropriate equivalence test.
Experiment Types
| Type | When to Use | Duration |
|---|---|---|
| A/B test | Binary choice, enough traffic | 2-6 weeks |
| Multi-variant (A/B/C) | Multiple alternatives | 3-8 weeks (more traffic needed) |
| Holdback | Measure long-term impact of shipped feature | 4-12 weeks |
| Sequential testing | Need early stopping | Varies (uses alpha spending) |
| Quasi-experiment | Can't randomize (e.g., pricing by region) | Varies |
Common Mistakes
| Mistake | Correction |
|---|---|
| Mixing pp and relative percent | Convert both to the alternative probability before powering |
| Lookup table disagrees with formula | Generate it from scripts/proportions.mjs; regression tests check equality |
| Nonsignificance means no effect | Report the interval, meaningful effects still compatible with it, and inconclusive verdict |
| Extending after seeing p = 0.06 | Follow a prespecified sequential/blinded extension rule or start a new preregistered test |
| Treating users in one account as independent | Randomize/analyze at the account level or use a clustered method |
| Applying normal tests to zero conversions | Use a suitable exact/rare-event method and state approximation limits |
Experiment Methodologyreferences/experiment-methodology.md
An experiment is a decision written down before the data arrives: the baseline, the effect worth detecting, the guardrails, and what ships or kills it. A change not yet shipped is design; results in hand are analysis. Run the steps the question needs: a sample-size request is answered by design steps 1 and 5. An experiment is worth its cost only when its result can change the decision; business-case (step 7) decides that, and its card is the short form of this design.
Mode. Standalone or as part of phases 3, 6 and 7, per operating modes; design and analysis apply in both. Load evidence-ledger when recording claims and the shapes in references/analytics-contract.md when querying. Skill-local resources:
- Calculations and readout for sample size and significance.
- Design reference for the hypothesis template, metric and randomization specification, runtime rule, worked examples, experiment types and the full list of traps.
- Output contracts when writing the design or the readout.
Stage. Read PRODUCT.md → Stage. Before PMF (idea, pre-PMF) traffic is too small for significance to mean anything: write the thresholds before the test, accept a small sample and declare its size, and judge the result qualitatively against those thresholds, reported as directional. After PMF the full procedure applies.
Procedure
Design
- Establish the baseline: the current output-metric rate, tagged. A guessed baseline gives a confidently wrong sample size, so an unavailable one is asked for and its uncertainty carried. Done when the baseline has a value, a window and a tag.
- Write the hypothesis from the template: the change, the metric, the direction, the effect size worth detecting, and the mechanism. Done when every field of the template is filled.
- Define the metrics triad: one preregistered primary (output) outcome, an input indicator when useful, and the guardrails that catch a win breaking something else. Done when each metric has its definition and population.
- Verify the metrics are emitted. An unemitted output metric makes the experiment unreadable; that finding goes to
tracking-standardsbefore anything ships. Done when each metric is confirmed emitted, or the gap is handed over. - Calculate sample size and runtime from the baseline, the minimum detectable effect and the traffic. Done when the first read has a calendar date.
- Pre-register before the experiment starts: what ships it (the build line, set where the second option in the list becomes the better bet), what kills it (the stop line), what the band between them triggers, whether a preregistered sequential or blinded extension is permitted, its maximum sample and duration, and who decides. Done when the pre-registration is written and dated before the first exposure.
Analysis
- Collect the results for every metric, per variant, each tagged. Done when every preregistered metric has a value per variant.
- Check validity before significance: the full planned duration covering whole weeks, the intended split, instrumentation stable throughout. Done when each check passes or the result is declared invalid with the reason.
- Compute significance with the preselected method in
references/proportions.md, on the one pre-registered primary metric. Done when the estimate has its interval. - Read the guardrails. A guardrail breach outranks an output win. Done when every guardrail has a verdict.
- Apply the pre-registered decision rule. An inconclusive result is named as such; a nonsignificant one is read through its interval for both meaningful benefit and harm. A fixed-horizon test ends at its horizon. Done when the decision follows from the rule written in design step 6.
- Report, including what the experiment leaves unanswered. Done when the output contract is filled.
Watch for
| Do | Instead of |
|---|---|
| Convert pp and relative percent to the alternative probability before powering | Mixing the two |
Generate lookup tables from scripts/proportions.mjs | A table that disagrees with the formula |
| Randomize and analyze at the account level, or use a clustered method | Treating users in one account as independent |
| An exact or rare-event method for zero conversions, limits stated | Normal tests on zeros |
Capabilities
| Capability | Used for | Floor when absent |
|---|---|---|
analytics.query | Baseline and results readout | Ask for the baseline, tag it, and state that the power calculation inherits its uncertainty |
analytics.events | Whether output and guardrail metrics are emitted | Search the repository for the call sites |
db.query | Outcomes in the application database | Ask |
repo.read | Flag and assignment code, to verify randomization | Ask how assignment works |
files.read / files.write | The pre-registration and the readout | Always present |
Design needs nothing connected. Analysis needs numbers, and two conversion counts pasted by the person are a legitimate source.
Output Contract
## EXPERIMENT DESIGN COMPLETE or ## EXPERIMENT ANALYSIS COMPLETE, in the shape of its output contract.
Experiment Output Contractsreferences/experiment-output-contracts.md
Read when writing a design or an analysis readout. Standalone work keeps its requested format and destination.
## EXPERIMENT DESIGN COMPLETE
**Hypothesis:** {statement with mechanism}
**Baseline:** {value, tag} · **MDE:** {absolute pp and relative %, direction} · **Sample per variant:** {n} · **Runtime:** {days, first readable on date}
**Metrics:** output {…} · input {…} · guardrail {…}
**Instrumentation:** {emitted / missing, per metric}
**Decision rule:** ship if {…} · kill if {…} · inconclusive if {…} · permitted extension {method, cap, or none}## EXPERIMENT ANALYSIS COMPLETE
**Validity:** {duration, split, instrumentation stability}
**Result:** {metric, control, variant, lift, p-value or interval}
**Guardrails:** {each, with verdict}
**Decision:** {ship / kill / extend / inconclusive}, per the pre-registered rule
**Cannot conclude:** {what this experiment does not answer}Tracking Plan Templatereferences/plan-template.md
The output contract for tracking-standards. Standalone output follows the requested format and destination; adapt the template only where useful and omit lifecycle gate claims.
## TRACKING PLAN COMPLETE
**Feature:** {name}
**Capabilities resolved:** {capability → concrete source, or "none: files only"}
### Event Taxonomy
| Event | Trigger | Properties | Question it answers | New or existing |
### Funnels
{ordered steps per path, with conversion windows}
### Dashboard Spec
{shape, events, breakdowns, per tile}
### Implementation Checklist
{per event: call site, available properties, verification}
### Findings
{dead events, duplicate events, missing properties for the segments that matter}Two-proportion calculationsreferences/proportions.md
Load only for binary A/B sample size or analysis. This skill-local reference and ../scripts/proportions.mjs resolve relative to their real source paths. No connected provider or script execution is required for design; no baseline may be invented.
Calculation source and assumptions
The executable source is scripts/proportions.mjs in the owning skill directory, using only Node built-ins. Equal allocation, independent binary outcomes, one primary metric, fixed horizon, two-sided alpha 0.05 and power 0.80. It uses approximate normal quantiles 1.96 and 0.84, with ceiling to a whole count per arm:
p2 = p1 + absolute_MDE (increase)
p2 = p1 - absolute_MDE (decrease)
absolute_MDE = p1 × relative_MDE (when supplied as relative lift)
n = ceil((1.96 + 0.84)^2 × (p1(1-p1) + p2(1-p2)) / (p2-p1)^2)Inputs are probabilities/fractions (0.05 = 5%); 5pp is 0.05, 10% relative lift is 0.10. Both baseline and alternative must be strictly in (0, 1); the helper rejects impossible effects, zero/negative effects and non-finite values. This simplified planning approximation is not an exact guarantee of power. Check expected successes/failures are sufficiently large; rare outcomes, cluster assignment, repeated measurements, uneven allocation, multiple arms and sequential stopping require their own calculation. Record attrition adjustments separately instead of silently changing n.
From the installation root, run node skills/tracking-standards/scripts/proportions.mjs 0.05 0.05 absolute or node skills/tracking-standards/scripts/proportions.mjs 0.05 0.10 relative. This is an optional local calculation, not a host requirement. The formula is the identical inline fallback.
Generated lookup (increase, 95% confidence, 80% power, per arm)
Generated by node skills/tracking-standards/scripts/proportions.mjs --table. The script tests regenerate and compare the complete table:
| Baseline | MDE 1pp | MDE 2pp | MDE 5pp | MDE 10pp |
|---|---|---|---|---|
| 5% | 8,146 | 2,207 | 432 | 138 |
| 10% | 14,732 | 3,834 | 683 | 196 |
| 15% | 20,533 | 5,265 | 902 | 247 |
| 20% | 25,551 | 6,500 | 1,090 | 291 |
| 30% | 33,234 | 8,381 | 1,372 | 353 |
| 40% | 37,781 | 9,479 | 1,529 | 385 |
| 50% | 39,193 | 9,793 | 1,561 | 385 |
Readout
Choose the test before outcomes. For an ordinary independent binary fixed-horizon test, a pooled two-proportion z-test under the zero-difference null uses:
p_pool = (success_control + success_treatment) / (n_control + n_treatment)
SE_null = sqrt(p_pool × (1-p_pool) × (1/n_control + 1/n_treatment))
z = (p_treatment - p_control) / SE_null
p_value = 2 × (1 - Phi(abs(z)))An approximate difference interval uses the unpooled standard error:
SE_difference = sqrt(p_control(1-p_control)/n_control + p_treatment(1-p_treatment)/n_treatment)
95% CI = difference ± 1.96 × SE_differenceThese approximations fail at sparse/boundary counts; do not report a zero-width interval after zero conversions as certainty. Use a suitable score/exact method when needed. A pooled test and unpooled Wald interval can disagree near a threshold: state both methods rather than requiring them to match. Account for multiplicity when the registered design has several hypotheses.
| Finding | Interpretation |
|---|---|
| Benefit above business threshold, acceptable guardrails, valid design | Apply the preregistered launch rule; statistical significance alone does not authorize a release |
| Significant improvement smaller than business threshold | Evidence of an effect, not automatically enough business value |
| Meaningful harm or guardrail breach | Apply the registered stop/kill rule |
| Interval spans meaningful benefit and harm/zero | Inconclusive; do not claim no effect |
| Interval excludes effects worth pursuing | Evidence against that size of benefit; practical-equivalence claims need registered margins/method |
Do not extend a completed fixed-horizon test based on nonsignificance. Optional stopping needs a prespecified sequential design/alpha spending; a blinded sample-size reassessment must follow its prespecified rule and cap. Otherwise preregister a new independent follow-up. Report assignment validity, counts, effect in pp and relative percent, interval, test method, guardrails and the result's limits.
skills/tracking-standards/SKILL.mdView on GitHub