Using your preferred text editor, create a YAML file in your Data Catalog project and add the below content:
Basic structure
You can define Tracking Plans in YAML files with the kind: tp specification.
version:rudder/0.1kind:tpmetadata:name:mytrackingplanspec:id:mytrackingplandisplay_name:"Product Tracking Plan"description:"Contains all the events and properties for the Product Tracking Plan."rules:- type:event_ruleid:product_viewed_ruleevent:$ref:"#/events/myeventgroup/product_viewed"allow_unplanned:falseproperties:- $ref:"#/properties/mypropertygroup/product_sku"required:true
Each Tracking Plan definition requires:
A unique identifier (id)
A display name (display_name)
A description (description)
Rules (rules) that reference events and their properties
The following examples show how to define Tracking Plans for different use cases:
version:rudder/0.1kind:tpmetadata:name:ecommerce_trackingspec:id:ecommerce_trackingdisplay_name:"Ecommerce Tracking"description:"Tracking Plan for ecommerce events"rules:- type:event_ruleid:product_viewed_ruleevent:$ref:"#/events/ecommerce/product_viewed"properties:- $ref:"#/properties/product/sku"required:true- $ref:"#/properties/product/name"required:true- $ref:"#/properties/product/price"required:true- $ref:"#/properties/product/category"required:false
version:rudder/0.1kind:tpmetadata:name:user_auth_trackingspec:id:user_auth_trackingdisplay_name:"User Authentication Tracking"description:"Tracking Plan for user authentication events"rules:- type:event_ruleid:user_registered_ruleevent:$ref:"#/events/auth/user_registered"properties:- $ref:"#/properties/user/email"required:true- $ref:"#/properties/user/signup_method"required:true- $ref:"#/properties/user/referral_source"required:false
Validate and deploy Tracking Plans
Before deploying your Tracking Plans to the workspace, validate them to ensure they follow the correct structure and meet your requirements.
Validate Tracking Plans
Run the following command to validate your Tracking Plan definitions:
rudder-cli tp validate -l ~/tutorial-catalog
The command checks your Tracking Plan definitions for:
Required fields and correct structure
Valid event and property references
Unique identifiers across your catalog
Proper YAML syntax
If validation succeeds, the command returns no output. If it finds any issues, it displays specific error messages to help you fix them.
Deploy Tracking Plans
After validating your Tracking Plans, deploy them to your RudderStack workspace:
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.