Git-based Tracking Plan Management Quickstart Alpha

Get started with creating and deploying a Tracking Plan using the Rudder CLI tool.
Available Plans
  • free
  • starter
  • growth
  • enterprise

This quickstart guide shows you how to use the Rudder CLI tool to create and deploy a Tracking Plan to your workspace.

info
See End-to-End Walkthrough for a detailed, step-by-step walkthrough of this feature.

Prerequisites

1. Authenticate the CLI tool

Run the following command and enter your access token when prompted:

rudder-cli auth login

2. Create a project directory

Create a project directory to store your Data Catalog YAML files:

mkdir ~/tutorial-catalog

3. Define events, properties, and custom types

Create the following YAML files in your project directory:

  • Events (~/tutorial-catalog/events.yaml)
version: rudder/0.1
kind: events
metadata:
  name: myevents
spec:
  events:
    - id: product_viewed
      name: "Product Viewed"
      event_type: track
      description: "Triggered when a user views a product"
  • Properties (~/tutorial-catalog/properties.yaml)
version: rudder/v0.1
kind: properties
metadata:
  name: myproperties
spec:
  properties:
    - id: product_sku
      name: "SKU"
      type: string
      description: "Product SKU"
    - id: price
      name: "Price"
      type: integer
      description: "Product price"
  • Custom Types (~/tutorial-catalog/custom-types.yaml)

4. Create a Tracking Plan

Create a Tracking Plan that references your events and properties (~/tutorial-catalog/tracking-plan.yaml):

version: rudder/0.1
kind: tp
metadata:
  name: ecomm-tracking-plan
spec:
  id: ecomm-tracking-plan
  display_name: "Product Tracking Plan"
  description: "Tracking plan for product-related events"
  rules:
    - type: event_rule
      id: product_viewed_rule
      event:
        $ref: "#/events/myevents/product_viewed"
      allow_unplanned: false
      properties:
        - $ref: "#/properties/myproperties/product_sku"
          required: true
        - $ref: "#/properties/myproperties/price"
          required: true

5. Validate and deploy

  1. Validate your files:
rudder-cli tp validate -l ~/tutorial-catalog
  1. Optional: Review changes before deploying:
rudder-cli tp apply -l ~/tutorial-catalog --dry-run
  1. Deploy changes to your workspace:
rudder-cli tp apply -l ~/tutorial-catalog

Next steps



Questions? Contact us by email or on Slack