What is an Event Schema?
The formal definition of a single analytics event: its name, description, every property it carries with names and types, which properties are required, and which platforms implement it. An event schema is the source of truth for how an event should be implemented. A collection of event schemas across a product constitutes a tracking plan. Schemas should be versioned so that changes are recorded and breaking changes can be detected.
Why event schemas matter
An event without a schema is a guess. When there is no formal definition of what properties an event carries and what types those properties use, every engineer implementing the event makes their own assumptions. One might send price as a float in dollars; another might send it as an integer in cents. Both implementations look correct in code review. Both break aggregation in the warehouse.
Event schemas eliminate this ambiguity by acting as a contract. They define exactly what a valid event looks like, which means implementations can be validated against them automatically. This shifts error detection from "someone noticed a dashboard looks wrong three weeks later" to "the build failed because a required property was missing."
Schemas also make analytics maintainable over time. When a new engineer joins the team, they do not need to reverse-engineer what item_value means or whether currency is an ISO code or a display string. The schema documents it. When a property needs to change, the schema provides a clear record of what existed before, enabling safe schema versioning.
How it works in practice
An event schema defines a single analytics event in full detail. A typical schema includes the event name (such as Order Completed), a human-readable description of when the event fires, and a list of properties. Each property specifies a name, a data type (string, integer, float, boolean, or an enum of allowed values), and whether the property is required or optional.
For example, the schema for an Order Completed event might define properties like order_id (required string), total_usd (required float), item_count (required integer), payment_method (required enum of card, paypal, bank_transfer), and promo_code (optional string). This schema makes the event unambiguous for any engineer on any platform.
A collection of event schemas forms your tracking plan. When schemas are stored as structured data rather than free-form text, they can power automation: type-safe code generation, CI validation, and runtime schema checking. This is where the real leverage of schemas shows up. They stop being documentation and become an active part of your development workflow.
Common mistakes
- Leaving property types vague. Writing "amount" without specifying float-in-dollars versus integer-in-cents guarantees type mismatches across platforms. Every property needs an explicit data type and unit.
- Not marking properties as required or optional. When it is unclear whether a property should always be present, some implementations will include it and others will not. This breaks aggregations that assume the property exists.
- Using free-text where enums belong. A
plan_tierproperty typed as a string will eventually contain "Pro", "pro", "PRO", and "professional." Define an enum of allowed values in the schema to prevent this. - Confusing a schema with a tracking plan. A schema defines a single event. A tracking plan is the collection of all schemas plus metadata like ownership, platform coverage, and lifecycle status. Both are necessary; neither replaces the other.
Frequently asked questions
What goes in an event schema?
At minimum: the event name, a description of when it fires, and a list of properties with names, types, and required/optional status. Richer schemas also include allowed enum values, platform coverage (which platforms implement this event), the event owner, and a version number. The more detail the schema contains, the more it can be used for validation and code generation.
What is the difference between a schema and a tracking plan?
An event schema defines a single event: its name, properties, and types. A tracking plan is the collection of all event schemas across your product, plus organizational metadata like event categories, owners, platform assignments, and lifecycle status. Think of schemas as the rows and the tracking plan as the table.
How should you version event schemas?
Record a new version whenever a property is added, removed, or changed in type. Use semantic versioning or a simple incrementing number. Breaking changes (removing a required property, changing a type) should increment the major version and trigger a review. Non-breaking changes (adding an optional property) can increment the minor version. Learn more about schema versioning practices.
Can event schemas be enforced automatically?
Yes, and this is where schemas deliver the most value. Structured schemas can be used to generate type-safe tracking code that enforces property names and types at compile time. They can also be used for runtime validation in a CDP or event collector, rejecting or flagging events that do not conform to the schema before they reach the warehouse.
Related terms
Put these concepts into practice with Ordaze.
Try Ordaze free