A meditation app's paywall funnel halves on one platform after a team renames an event; how should analytics event names and properties be governed?
answer
- strings drift, dashboards break silently
- a reviewed registry is the source
- object, then past-tense action
- typed builders, not string calls
- add fields; never rename or retype
basics
~20 sFree-form event strings drift until dashboards break silently. Keep a reviewed registry of every event with its owner and typed properties, generate typed builders for each client from it, validate at ingest, and change schemas only by adding fields or versions.
solid answer
~50 sA free-form `track("Paywall Viewed", {...})` call lets each team choose names, casing and property types, so one platform sends `paywall_view` and the other `paywall_viewed`, a price arrives as text here and a number there, and nobody owns the event when it stops firing. I'd keep one registry of events, reviewed like an API: a name in an `object_action` convention, an owner, a description of when it fires, typed properties marked required or optional, allowed values, and a personal-data class. Typed builders are generated from it for every client, so a misspelt name or a missing property fails the build. The ingest service validates against the same registry and quarantines failures with a count. Changes are additive; a rename or a type change becomes a new event or schema version, because builds from two years ago keep sending the old one.
code
json · 13 lines{
"name": "paywall_viewed",
"owner": "subscriptions",
"trigger": "Fired once when the paywall is fully on screen.",
"schema_version": 2,
"personal_data": "none",
"sampling": "never",
"properties": {
"placement": {"type": "enum", "values": ["onboarding", "session_end", "settings"], "required": true},
"plans_shown": {"type": "integer", "required": true},
"price_tier": {"type": "enum", "values": ["standard", "discounted"], "required": false}
}
}go deeper
Recall why events need fixed names and typed properties, and that one naming convention applies on every platform.
Explain the registry's fields, how typed builders turn a misspelt event into a build failure, and what the pipeline's common envelope adds.
Show how schemas change when builds stay installed for years: additive changes, new versions for breaking ones, and ingest validation counted by app version.
Set the review and ownership process for events across teams, including who may add personal-data properties and when an event is retired.
## Why free-form events rot When an event is just a string and a map of properties, every team makes its own choices, and the drift is silent: - **Names drift.** `paywall_viewed`, `PaywallView` and `view_paywall` all appear, sometimes from two platforms of the same app. - **Types drift.** A price is sent as `"9.99"` by one client and `9.99` by the other; a sum over the column quietly ignores half the rows. - **Meaning drifts.** `session_completed` means "listened for one minute" in one build and "reached the end" in another. - **Personal data leaks in.** A convenient `details` property ends up holding a mood-journal note or an email address. - **Events are orphaned.** When an event stops firing nobody notices, because nobody owns it. The paywall funnel joins events by name: `paywall_viewed`, then `plan_selected`, then `trial_started`. One renamed event on one platform makes conversion there appear to halve overnight, and the team spends days on a drop that is only a naming change. ## The registry Every event lives in one **schema registry**, a reviewed file or service that is the source of truth: | Field | Example | Why it is there | |---|---|---| | Name | `paywall_viewed` | one `object_action` convention, past tense | | Owner | the subscriptions team | someone answers when it breaks | | Trigger | fired once when the paywall is fully on screen | everyone counts the same moment | | Properties | `placement`: enum; `plans_shown`: integer | typed, required or optional | | Personal-data class | none | decided once, enforced by the client | | Sampling class | never sampled | volume rules travel with the event | | Schema version | 2 | old and new shapes can be told apart | Which properties count as personal data is classified by the data governance process; the registry records the result so that every client enforces it. ## Typed builders instead of strings From the registry, generate a typed builder for each client codebase. Each event becomes a function with typed parameters: - a misspelt event name cannot be written, because there is no such function; - a missing required property fails the build; - enum properties accept only the registered values; - free text has no slot unless the registry deliberately gives it one. A cross-platform app generates one set; a pair of native apps generates two from the same file, which is what keeps the platforms' names identical. ## The envelope belongs to the pipeline Feature code supplies only the event's own properties. The pipeline adds a common **envelope** to every event: the event id and sequence number, the install id, the account id when signed in and allowed, the session id, the **app version and build**, the OS family and version, the schema version, the recorded time with its time-zone offset, the consent version and the sampling rate. App version and build on every event is what lets an analyst read data from a build released two years ago, and separate a real change in behaviour from a change in instrumentation. ## Changing a schema when old builds live for years 1. **Additive change**, such as a new optional property: same event, same version; old builds simply omit it. 2. **Breaking change**, such as a rename, a new type or a new meaning: a new event name or a new schema version. The old one stays in the registry, marked as still received from older builds, and the analysis maps both. 3. **Never reuse a retired name** for a different meaning. 4. **Retire an event** only when counts by app version show the fleet no longer sends it. ## Validation and review The ingest service validates each event against the registry, using the schema version the event declares, so an old build's valid old shape is not mistaken for a broken new one. Unknown names, missing required properties and wrong types are quarantined, counted by event and app version, and alerted on when a new release starts producing them; they are never silently coerced into the main tables. Changes to the registry go through review by the event's owner, the analytics team and whoever owns privacy, and a periodic report lists events that have stopped arriving. Three counters, broken down by app version, catch most problems early: - events quarantined, by reason; - registered events that no build has sent for a set period; - events whose volume per active install moved sharply after a release, which is usually instrumentation rather than behaviour.
- Why not accept anything at ingest and clean it up in the warehouse?Cleaning later means guessing what each variant meant, per app version, for as long as old builds keep sending them, which can be years. Rejecting invalid events at build time and validating at ingest moves the cost to the one moment the author still knows what the event means.
- What counts as a completed session must change; how do you ship that?Add a new event or schema version with the new definition and keep the old one unchanged, recording both until the old builds fade. Redefining the event in place mixes two meanings in one chart, separable only by app version, and nobody remembers which version switched.
- Event names are only strings; dashboards can map the variants later.
- Renaming an event is safe once the new build is released.
- Each feature team should add the app version to its own events.
- A free-text details property makes events flexible at no cost.
- Silently coercing wrong property types at ingest keeps the data clean.