Skip to content

Event Schema ​

The event schema defines the structure and properties of your analytics events.

Configuration ​

Event ​

FieldTypeRequiredDescription
namestringyesEvent name
descriptionstringnoEvent context description
dimensionsstring[] or { included: string[], excluded: string[] }noEvent dimension associations
passthroughbooleannoAllow arbitrary properties
propertiesProperty[]noEvent properties

Example ​

yaml
events:
  page_view:
    name: Page View
    description: Triggered when a user views a page.
    properties:
      - name: Page Name
        description: The name of the page that was viewed.
        type: string

  add_user:
    name: Add User
    description: Triggered when an admin adds a user to their team.
    properties:
      - name: Role
        description: The role of the user that was added.
        type: [admin, member]

Multi-Implementation Events ​

Like words in a dictionary, a single event can have multiple definitions, known as "implementations". This allows you to craft coarse grained taxonomy that is easy to digest, while maintaining the fine grained resolution of individual event implementations.

For example, a platform may support bulk actions, which have a started, completed, and failed state. But it may not be desirable to take up 3 separate events in the taxonomy.

With Voltage, you can create separate implementations for each object type, each with unique property requirements, that all roll up into a single event.

Example Implementations:

yaml
events:
  bulk_action_started:
    name: Bulk Action
    description: Triggered when a bulk-action is started.
    properties:
      - name: Notify User
        description: Indicates whether or not the user will be notified when the bulk-action succeeds or fails.
        type: boolean
      - name: Bulk Action Status
        description: The status of the bulk-action.
        defaultValue: started
        type:
          - started

  bulk_action_completed:
    name: Bulk Action
    description: Triggered when a bulk-action succeeds.
    properties:
      - name: Records Updated
        description: The number of records successfully updated by the bulk-action.
        type: number
      - name: Bulk Action Status
        description: The status of the bulk-action.
        defaultValue: completed
        type:
          - completed

  bulk_action_failed:
    name: Bulk Action
    description: Triggered when a bulk-action fails.
    properties:
      - name: Failed Reason
        description: The reason why the bulk-action failed.
        type: string
      - name: Bulk Action Status
        description: The status of the bulk-action.
        defaultValue: failed
        type:
          - failed

In this example, the Bulk Action event has 3 separate implementations with unique property requirements. When these events are tracked, they will automatically include a configurable Event Key property, which will be one of bulk_action_started, bulk_action_completed, or bulk_action_failed.

Please refer to our codegen docs to learn how to configure the Event Key property.