Skip to content

Events

Event files define individual analytics events with taxonomy metadata and payload specifications.

# yaml-language-server: $schema=https://opentp.dev/schemas/event.schema.json
opentp: 2025-06
event:
key: auth::login_button_click
lifecycle:
status: active
taxonomy:
area: auth
event: login_button_click
action: User clicks the login button
payload:
platforms:
all:
active: 1.0.0
history:
1.0.0:
changes: []
schema:
event_name:
value: login_button_click
auth_method:
type: string
enum: [email, google, github]
required: true
FieldTypeRequiredDescription
opentpstringYesFormat version
eventobjectYesEvent definition
FieldTypeRequiredDescription
keystringYesUnique event identifier
lifecycleobjectNoEvent status
taxonomyobjectYesMetadata fields
payloadobjectYesAnalytics data
aliasesarrayNoPrevious event keys
ignoreChecksarrayNoSkip specific validations

Unique identifier matching the pattern defined in opentp.yaml:

key: auth::login_button_click

The key is typically generated from taxonomy values using transforms.

lifecycle:
status: active # active | deprecated | draft
StatusDescription
activeEvent is in production
deprecatedEvent is being phased out
draftEvent is being developed

Metadata fields defined in your opentp.yaml:

taxonomy:
area: auth
event: login_button_click
action: User clicks the login button

Values must match any configured dictionaries or rules.

payload:
platforms:
all:
active: 1.0.0
history:
1.0.0:
schema:
event_name:
value: login_click
ios:
active: 1.0.0
history:
1.0.0:
schema:
event_name:
value: login_click
device_model:
type: string
required: true

Platform-specific fields use full override (not inheritance). Each platform must define its complete schema.

Each platform group can have:

FieldTypeDescription
activestringCurrent active version
historyobjectVersion history with schemas
history:
1.0.0:
changes: []
schema:
event_name:
value: login_click
1.1.0:
changes:
- Added auth_method field
schema:
event_name:
value: login_click
auth_method:
type: string
required: true

Fields can be defined as:

Fixed value:

event_name:
value: login_click

Typed field:

auth_method:
type: string
required: true

With enum:

auth_method:
type: string
enum: [email, google, github]
required: true

With dictionary:

application_id:
type: string
dict: data/application_id
required: true

Full field definition:

dimension_1:
type: string
title: Auth Method
description: Method used to authenticate
enum: [email, google, github]
required: true
rules:
max-length: 50

Track previous event keys for migrations:

aliases:
- key: old_login_click
deprecated:
reason: Renamed for consistency
date: 2025-01-01

Skip specific validations:

ignoreChecks:
- path: payload.schema.legacy_field
reason: Temporary field for migration