Introduction

What is events.win?

events.win is the easiest way to create a scalable tracking plan. The goal is to solve three problems:

1. Scalability: A single source of truth for data models

For most tracking plan solutions, data models that are shared across events have to be defined in multiple places. This leads to inconsistencies and makes it harder make changes. events.win solves this by defining data models in a single place and generating code for each event.

For example, say we have two events that both track a user:

{
  "event": "sign-up",
  "properties": { "id": "string", "email": "string", "name": "string" }
}
 
{
  "event": "account-deleted",
  "properties": { "id": "string", "email": "string", "name": "string" }
}

With events.win, we can define a single data model for a user, and then reference it in each event:

{
  "name": "user",
  "properties": { "id": "string", "email": "string", "name": "string" }
}
 
{
  "event": "sign-up",
  "properties": { "user": "user" }
}
 
{
  "event": "account-deleted",
  "properties": { "user": "user" }
}

This makes it easy to make changes to the user data model without having to update each event. 🎉

2. Data Quality: Quickly find and fix tracking issues

When tracking plans are managed in a spreadsheet or a separate tool, it can be hard to validate that the data being sent is correct. events.win solves this by consuming your events and showing you correct/accurate your data is. Additionally, events.win generates type-safe code for developers to squash tracking bugs before they happen.

Analytics overview

3. Synchronization: Type-safe event definitions in 1 minute

When tracking plans are managed in a spreadsheet or a separate tool, it can be hard to keep them in sync with your codebase. events.win solves this by generating code for developers from your tracking plan. This means that your tracking plan can be easily updated and validated in your codebase.

// Generated code
// .events.win/types.ts
export interface User {
  id: string;
  email: string;
  name: string;
}
 
export interface SignUp {
  user: User;
}
 
export interface AccountDeleted {
  user: User;
}
// Generated code
// .events.win/segmentBrowser.ts
import { AnalyticsBrowser } from "@segment/analytics-next";
import { SignUp, AccountDeleted } from "./types";
 
const analytics = AnalyticsBrowser.load({
  writeKey: "<write-key>",
});
 
export const signUp = (payload: SignUp) => {
  analytics.track("sign-up", payload);
};
 
export const accountDeleted = (payload: AccountDeleted) => {
  analytics.track("account-deleted", payload);
};