You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/protocols/tracking-plan/create.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The Segment Tracking Plan feature allows you to validate your expected events ag
15
15
16
16
Tracking Plans are stored in workspaces and can be connected to one or more Sources.
17
17
18
-

18
+

19
19
20
20
## Create a Tracking Plan
21
21
@@ -70,7 +70,7 @@ You can apply `key:value` labels to each event to help organize your tracking pl
70
70
71
71
For consistency purposes, it's best that you create a standard way of labeling events and share it with all parts of your organization that will use Segment.
72
72
73
-

73
+

74
74
> info ""
75
75
> **Note:** Tracking Plan Labels are only available for Track and Page events.
76
76
@@ -160,6 +160,9 @@ To edit the common JSON schema using the Public API, you'll need to add your new
160
160
> info ""
161
161
> [Negative lookahead regexes (`?!`)](https://www.regular-expressions.info/lookaround.html) aren't supported. This means you can't use regex to prevent matches with a specific following character or expression. But, you can use `not` in the regex of your JSON schema to generate violations when a property key or value doesn't match the provided regex pattern.
162
162
163
+
> info "Specifying data type"
164
+
> Property or trait data type should adhere to the [data types defined by JSON schema](https://json-schema.org/understanding-json-schema/reference/type.html){:target="_blank”}. Data type names must be lower-cased as specified in JSON schema. Datetime properties should be represented as a `string` type with [`format` keyword](https://json-schema.org/understanding-json-schema/reference/string.html#format){:target="_blank”} (for example: "format": "date-time").
165
+
163
166
### Extend the Tracking Plan
164
167
Some customers prefer to manage the Tracking Plan with outside tools and resources. See the [APIs and extensions](/docs/protocols/apis-and-extensions/) section to learn more.
165
168
@@ -176,19 +179,19 @@ This can be helpful for mobile developers who might have several released versio
176
179
177
180
For example, say you want to add `subtotal` as a required property to your `Order Completed` event. You would start by adding the required property to the event in the Tracking Plan as shown in the example below.

180
183
181
184
Before Segment introduced event versioning, you would need to add the change to your tracking plan and any non-compliant events would generate violations, and possibly be blocked depending on your [event blocking settings](/docs/protocols/enforce/schema-configuration/).
182
185
183
186
### Create a new event version
184
187
With event versioning, you can now create multiple versions of the event definition as shown in the example below. To create a new event version, click into the overflow menu for an event and select **Add Event Version**.
185
188
186
-

189
+

187
190
188
191
### Dynamically validate track events against an event version
189
192
To ensure the Track events you send to a Segment source validate against the correct event version, you need to instrument your events to include a `context.protocols.event_version` key and version value. The version value must pass as an integer, and should match the number shown in the Tracking Plan version tab. In the example below, the version number would be **2**.
190
193
191
-

194
+

192
195
193
196
Next, add the event version number to the context object. For [analytics.js](/docs/connections/sources/catalog/libraries/website/javascript) Track calls, you would instrument the event as in the example below. Note how the JSON objects for `context`, `protocols`, and `event_version` are nested.
0 commit comments