Create a tracking plan
In Amplitude Data, the tracking plan is a living document that outlines what events and properties to track, why you're tracking them, and where they come from. The plan lets all stakeholders in your organization work together on a single source of truth. Analysts use this information to find which events and properties to use and confirm their understanding of the data is correct. Developers use it to instrument the analytics schema in the code base.
This article focuses on how to create your tracking plan directly in Amplitude Data. Refer to the data planning playbook to understand how planning in Amplitude Data fits into the planning process.
Find your tracking plan
Each project in Amplitude has its own tracking plan. To find your plan, select the Data tab in the top navigation. Then, in the left navigation, select the project from the dropdown at the top.
The events and properties for your plan appear on the left.
Update your tracking plan
You can update your plan in two ways:
- Proactively plan new events and properties before implementation, and use Amplitude Data to define details, work together with team members, and agree on what you want to track. (Recommended.)
- Reactively plan events and properties after Amplitude ingests for the first time. By default, these events and properties appear in your plan as "Unexpected." You can add them to your plan, or delete them to stop ingestion and remove them from your data catalog.
Create a source
Sources represent the originating source of the data sent to Amplitude (for example, your iOS, Android, Web, and Backend). When using the Ampli Developer experience, you need to create a source to generate the correct tracking library.
To create a source, follow these steps:
- Navigate to Data > Sources and select Add Source.
- Select the SDK source you want to add.
- Name your new source and select Create.
Create an event
An event is a distinct action that a user can take in your product. When you create an event, you can specify metadata about the event that helps with both implementation and discovery in Analytics after implementation.
To create an event, follow these steps:
Navigate to Data > Events and select Create event.
Give your event a name. Amplitude suggests any modifications to match your naming convention.
Add a source to specify where to instrument this event.
Add any relevant metadata, including:
- A description to help define when to send the event or important details about the event.
- A category to provide more context and group similar events.
- The active or inactive status of the event. An active event is one the user triggers. Inactive events relate to the user, but a direct user action doesn't initiate them (for example, receiving a push notification).
Add any relevant event properties to the event.
Create an event property
Event properties describe the event and the context in which a user triggered it. For example, a Song Played event might contain a Song Title property. A name, description, examples, and rules define each property. Rules are specific to each data type. For example, property Song Title of type String can have the following rules: Min Length, Max Length, and Regex.
To create a new event property, follow these steps:
In Amplitude Data, navigate to Data > Properties and select the Event Properties tab.
Select Create event property.
Give your event property a name and add any relevant metadata to the property, including:
- A description. Including example values can be helpful.
- Whether this property is required on this event. If it is, and Amplitude receives an event that doesn't include it, Amplitude Data generates a warning.
- The data type (such as string or number) and any additional rules.
You can now add this property to your events.
To add an existing property, or create a new property within an event, follow these steps:
- In Amplitude Data, navigate to Data > Events and select the event you want to add a property to.
- In the event detail pane, select Add property.
- Name your new property, or select an existing property to add to the event.
If multiple events share similar properties, you can create a property group. Property groups, which are distinct from group properties, make it easier to manage complex tracking plans because you don't have to keep adding the same properties repeatedly. When you update a property group, the update applies to all events associated with the group.
Create a user property
User properties capture traits about the user. After you set a user property, it automatically applies to any subsequent events the user triggers, until its value updates.
To create a new user property, follow these steps:
In Amplitude Data, navigate to Data > Properties and select the User Properties tab.
Select Create user property. Give your new user property a name.
Add any relevant metadata to the property, including:
- A description. Including example values can be helpful.
- The data type (such as string or number) and any additional rules.
Create a group with group properties
This feature requires the Accounts add-on.
Group properties make it easy to associate a user with a particular account (for example, name, industry, or employees) whenever the group() call runs. Group properties help when you want to track groups of users (for example, tracking events across an entire company, instead of specific users within that company).
To create a group, follow these steps:
In Amplitude Data, navigate to Data > Groups and select Create group.
Name your group and add any relevant metadata, including:
- A description. Including example values can be helpful.
- The data type (such as string or number) and any additional rules.
Add any group properties that apply to this group type.
To create a group property, follow these steps:
In Amplitude Data, navigate to Data > Properties and select the Group Properties tab.
Select Create group property.
Name your group and add any relevant metadata, including:
- A description. Including example values can be helpful.
- The data type (such as string or number) and any additional rules.
Collaborate on your plan
If you want feedback on any changes you've made, you can @mention your colleagues in the rich text editor of any event or property to send them an email notification or Slack message. This approach helps when you're working on a branch and finalizing the event and property names you plan to use.
Send your plan to your developers
Finally, send this plan to your developers.
If you're using the Ampli Developer Tools, it consumes your tracking plan and presents it to developers as type-safe autogenerated code. Amplitude Data can generate a tracking library for all popular platforms and programming languages. The autogenerated library is a lightweight wrapper over your analytics provider's SDK that provides type-safety, supports linting, and enables additional features like input validation. The code exactly replicates the spec in the tracking plan and enforces all its rules and requirements.
You can also send them a link to the branch or directly to Amplitude Data, where they can review the details you specified.
Developers can also use the Amplitude Wizard CLI to instrument events. The wizard reads your codebase, proposes tracking events, and writes the code with developer approval, all from the terminal.
Was this helpful?