Tracking plans are managed in the tracking-plans/ directory of a Reflekt project.

Untitled

Defined as code

Reflekt tracking plans are defined using human-readable code (YAML files), allowing anyone to read, understand, and contribute to a plan. It’s this code that allows Reflekt to:

Events

Each event in a tracking plan has its own YAML file, located in the tracking-plans/plan-name/events/ folder. This makes it easy to add new or update existing events in a plan.

Reflekt takes an opinionated stance on required tracking plan best practices. At a minimum, each event must have:

Example Product Added event

# product-added.yml
- version: 1
  name: Product Added
  description: Fired when a user adds a product to their cart.
  metadata:
    code_owner: eng-squad-1
    priority: 1
    stakeholders:
			- product
      - marketing
  properties:
    - name: cart_id
      description: Cart ID to which the product was added to.
      type: string
      required: true
    - name: product_id
      description: Database ID of the product being viewed.
      type: integer
      required: true
    - name: name
      description: Name of the product.
      type: string     
      required: true
    - name: variant
      description: Variant of the product (e.g. small, medium, large).
      type: string
      enum:            
        - small
        - medium
        - large
      required: false  
    - name: price
      description: Price ($) of the product added to the cart.
      type: number
      required: true
    - name: quantity
      description: Quantity of the product added to the cart.
      type: integer
      required: true
    - name: discount_value
      description: Value of the discount in $ shown to the customer.
      type: number
      required: false

Event Properties

Event properties are defined under the properties: config in an event’s YAML file.

# product-added.yml
- version: 1
  name: Product Added
  description: Fired when a user adds a product to their cart.  
	properties:  # EVENT PROPERTIES CONFIG
    - name: cart_id
      description: Cart ID to which the product was added to.
      type: string
      required: true