Skip to content

opentp.yaml

The main configuration file defines your tracking plan structure, taxonomy, transforms, and validation rules.

opentp: 2025-06
info:
title: My Tracking Plan
version: 1.0.0
spec:
events:
key:
pattern: "{area}::{event}"
paths:
events:
root: /events
pattern: "{area}/{event}.yaml"
taxonomy:
area:
title: Area
type: string
required: true
event:
title: Event
type: string
required: true
payload:
platforms:
all: [web, ios, android]
schema:
event_name:
type: string
required: true
FieldTypeRequiredDescription
opentpstringYesFormat version (e.g., “2025-06”)
infoobjectYesProject metadata
specobjectYesTracking plan specification
info:
title: My Tracking Plan
version: 1.0.0
description: Analytics events for My App
contact:
- Analytics Team <analytics@example.com>
FieldTypeRequiredDescription
titlestringYesProject name
versionstringYesProject version
descriptionstringNoProject description
contactarrayNoContact information
spec:
events:
key:
pattern: "{area | slug}::{event | slug}"
paths:
events:
root: /events
pattern: "{area}/{event}.yaml"
dictionaries:
root: /dictionaries
pattern: "{path}.yaml"

Defines how event keys are generated from taxonomy values.

  • Use {field} to insert a taxonomy field
  • Use {field | transform} to apply a transform
  • Use :: or any separator between parts

Examples:

# Simple
pattern: "{area}::{event}"
# Result: auth::login_click
# With transform
pattern: "{area | slug}::{event | slug}"
# Result: auth::login_click (lowercase, underscores)
FieldTypeDescription
rootstringBase directory for events
patternstringFile path pattern using taxonomy fields
FieldTypeDescription
rootstringBase directory for dictionaries
patternstringFile path pattern (default: {path}.yaml)

Defines metadata fields for organizing events.

taxonomy:
area:
title: Area
type: string
dict: taxonomy/areas
required: true
rules:
max-length: 50
event:
title: Event
type: string
required: true
action:
title: Action
type: string
description: Human-readable description of when event fires
required: true

Each taxonomy field can have:

FieldTypeDescription
titlestringDisplay name
typestringstring, number, or boolean
descriptionstringField description
requiredbooleanWhether field is required
dictstringReference to a dictionary
enumarrayInline allowed values
rulesobjectValidation rules

Defines data sent to analytics platforms.

payload:
platforms:
all: [web, ios, android]
mobile: [ios, android]
schema:
event_name:
type: string
required: true
event_category:
type: string
required: false

Define platform groups:

platforms:
all: [web, ios, android] # Required: defines all platforms
mobile: [ios, android] # Optional alias
desktop: [web] # Optional alias

Default payload fields for all events:

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

Define reusable transform pipelines:

transforms:
slug:
steps:
- step: lower
- step: trim
- step: replace
params:
pattern: " "
with: "_"
- step: truncate
params:
maxLen: 160

Each transform step has a uniform format: { step: 'name', params?: {...} }

Define external validators (webhooks):

validators:
my-validator:
url: https://api.example.com/validate
timeout: 5s

Configure output generators:

generators:
- type: json
output: ./dist/events.json
- type: yaml
output: ./dist/events.yaml

Load custom extensions:

external:
rules:
- ./my-rules
transforms:
- ./my-transforms
generators:
- ./my-generators