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/unify/Traits/computed-traits.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Computed Traits allow you to quickly create user or account-level calculations t
18
18
19
19
{% include content/trait-types.md %}
20
20
21
-
## Types of Computed Traits
21
+
## Types of computed traits
22
22
23
23
Segment currently supports the following types of computed traits:
24
24
-[Types of Computed Traits](#types-of-computed-traits)
@@ -41,7 +41,7 @@ Segment currently supports the following types of computed traits:
41
41
> warning "Event Properties per Computed Trait limit"
42
42
> Segment limits the number of Event Properties on each Computed trait to 10,000. If your Computed Trait exceeds this limit, Segment will not persist any new Event Properties and will drop new trait keys and corresponding values.
43
43
44
-
### Event Counter
44
+
### Event counter
45
45
46
46
An Event Counter trait stores a count of an **event** over a period of time. For example, you can create a trait called `number_logins_90_days` based on a `User Logged In` event. You can also use event properties to only specific types of events.
47
47
@@ -69,9 +69,9 @@ Account-level use cases
69
69
70
70

71
71
72
-
### Most Frequent
72
+
### Most frequent
73
73
74
-
A most frequent user-level computed trait will return the **most common value** for an **event property**. This is helpful to create traits like `preferred_product_viewed` or `most_commonly_viewed_category` that tell you what a user's preferred product, or content category might be. Note that the most frequent computed trait requires the event property to have been tracked at least twice. In the case of a tie, Segment returns the first alphabetical value. For account-level computed traits, you can also return the most frequent **user trait**. This is helpful when you want to determine which user has performed an event the most frequently. For example, you might to return the email of the user in an account most actively viewing your app.
74
+
A most frequent user-level computed trait will return the **most common value** for an **event property**. This is helpful to create traits like `preferred_product_viewed` or `most_commonly_viewed_category` that tell you what a user's preferred product, or content category might be. Note that the most frequent computed trait requires the event property to have been tracked at least twice. In the case of a tie, Segment returns the first alphabetical value. For account-level computed traits, you can also return the most frequent **user trait**. This is helpful when you want to determine which user has performed an event the most frequently. For example, you might to return the email of the user in an account most actively viewing your app.
75
75
76
76
User-level examples:
77
77
- Favorite Blog Post
@@ -113,7 +113,7 @@ Account-level examples:
113
113

114
114
115
115
116
-
### Unique List
116
+
### Unique list
117
117
118
118
Unique list computed traits will output a **list of unique values** in alphabetical order for an **event property**. This is helpful to understand the different types of products or content that a customer or users in an account have interacted with or purchased. Customers are creating traits like `unique_product_categories_viewed` and sending them to email marketing tools and accessing them through the Profiles API for in-app personalization.
119
119
@@ -125,7 +125,7 @@ Example use cases:
125
125

126
126
127
127
128
-
### Unique List Count
128
+
### Unique list count
129
129
130
130
Unique list count computed traits will output a **count of the unique list of values** for an **event property**. Customers are creating traits like `unique_product_categories_viewed_count` to understand the variety of products that a customer is viewing. At the account-level, customers are creating traits like `unique_visitors_count` to calculate the number of unique visitors by ip address.
131
131
@@ -144,7 +144,7 @@ Account-level examples:
144
144
145
145
All computed trait types support a common "Add Conditions" section. Conditions defined here restrict the messages considered when calculating the final value of the computed trait by looking at a property of the events. For example, you could limits events to only those where "price" is greater than 30.00 or where "page.url" contains "pricing".
146
146
147
-
The following operators are available.
147
+
The following operators are available:
148
148
- equals
149
149
- not equals
150
150
- less than
@@ -162,15 +162,15 @@ The following operators are available.
162
162
- equals one of
163
163
- contains one of
164
164
165
-
## Connecting your Computed Trait to a Destination
165
+
## Connecting your computed trait to a destination
166
166
167
167
Segment sends user-level computed Traits to destinations using the [Identify call](/docs/connections/spec/identify/) for user traits, or using the [Track call](/docs/connections/spec/track/) for event properties. Segment includes the trait value and property in the Identify and Track calls.
168
168
169
169
For example, the name of a computed trait is added to the user profile as a trait, and the trait's value is set to the value of the computed trait. Segment sends an Identify or Track call when the trait is computed, depending on the destination configuration. If a computed trait counts the number of times a user visits your pricing page, and the user visits your pricing page five times, Segment sends an Identify call with the property `pricing_page_visits: 5`.
170
170
171
-
Learn more about [Computed trait generated events here](/docs/engage/using-engage-data/#computed-trait-generated-events). The trait name corresponds to the snake cased name that you see in the trait settings, for example `most_viewed_page_category`. See the [list of Engage-compatible destinations](/docs/engage/using-engage-data/#compatible-engage-destinations)
171
+
See [Computed trait generated events](/docs/engage/using-engage-data/#computed-trait-generated-events) to learn more. The trait name corresponds to the _snake_cased_name that you see in the trait settings, for example `most_viewed_page_category`. See the [list of Engage-compatible destinations](/docs/engage/using-engage-data/#compatible-engage-destinations).
172
172
173
-
For account-level computed traits, you have the option to send either a [Group](/docs/connections/spec/group/) call and/or [Identify](/docs/connections/spec/identify/) call. Group calls will send one event per account, whereas Identify calls will send an Identify call for each user in the account. This means that even if a user hasn't performed an event, Segment will still set the account-level computed trait on that user. Because most marketing tools are still based at the user level, it is often important to map this account-level trait onto each user within an account. See [Account-level Audiences](/docs/engage/audiences/account-audiences) for more information.
173
+
For account-level computed traits, you have the option to send either a [Group](/docs/connections/spec/group/) call and/or an [Identify](/docs/connections/spec/identify/) call. Group calls will send one event per account, whereas Identify calls will send an Identify call for each user in the account. This means that even if a user hasn't performed an event, Segment will still set the account-level computed trait on that user. As most marketing tools are still based at the user level, it is often important to map this account-level trait onto each user within an account. See [Account-level Audiences](/docs/engage/audiences/account-audiences) for more information.
174
174
175
175
> warning "Computed Traits can only be sent to Event destinations"
176
176
> When Engage sends a computed trait to an [Event destinations](/docs/engage/using-engage-data/#event-destinations), it uses an Identify call to send user traits and a Group call to send account-level computed traits.
@@ -183,7 +183,7 @@ After you create a computed trait, use the Overview page to view a compute progr
183
183
> info "Viewing compute progress"
184
184
> When you create a real-time computed trait, you'll see a progress bar, computed percentage, and status updates. For existing traits that you edit, Segment displays the compute status but not the progress bar or percentage.
185
185
186
-
## Editing Realtime Traits
186
+
## Editing realtime traits
187
187
188
188
Segment supports the editing of real-time Traits, which allows you to make nuanced changes to existing Traits in situations where cloning or building from scratch may not suit your use case.
189
189
@@ -200,7 +200,7 @@ Segment then processes your Trait edits. While the edit task runs, the trait rem
200
200
> warning ""
201
201
> It is not possible to edit a trait to convert it from real-time to batch, or vice-versa. If the computation type needs to be changed, you will need to recreate the trait with the appropriate conditions.
202
202
203
-
## Accessing your Computed Traits using the Profiles API
203
+
## Accessing your computed traits using the Profiles API
204
204
205
205
You can access your computed traits using the Profile API by querying the `/traits` endpoint. For example, you can query for the `emails_opened_last_30_days` with the following GET request:
206
206
@@ -231,13 +231,13 @@ By default, the response includes 20 traits. You can return up to 200 traits by
231
231
232
232
You can read the [full Profile API docs](/docs/unify/profile-api/) to learn more.
233
233
234
-
## Deleting Computed Traits
234
+
## Deleting computed traits
235
235
236
236
When computed traits are deleted, any user that had a value for that trait will now have a custom trait on the Unify profile.
237
237
238
-
## Downloading your Computed Trait as a CSV file
238
+
## Downloading your computed trait as a CSV file
239
239
240
-
You can download a copy of your trait by visiting the the computed trait overview page.
240
+
You can download a copy of your trait by visiting the computed trait overview page.
241
241

242
242
Computed Trait CSVs are generated on demand. Before you can download the CSV, you will need to generate it. There are three different options for formatting:
243
243
-**Unformatted:** Contains three columns. The first contains the user or account key, the second contains the trait value and the third is a JSON object containing the external IDs. Generating this CSV is by far the fastest of the three options. [Download example unformatted CSV](/docs/engage/files/trait_csv_format_a.csv)
@@ -247,7 +247,7 @@ Computed Trait CSVs are generated on demand. Before you can download the CSV, yo
247
247
<tr>
248
248
<td></td>
249
249
<td width="45%">Generating a CSV can take a substantial amount of time for large traits (around 30 seconds for a formatted CSV with 1 million rows). For CSVs that are expected to take over 20 seconds, the Segment app displays an estimated generation time. After clicking Generate, it is recommended that you leave the modal and page open while the CSV is created.
250
-
(If the trait recalculates between when you click Generate and when you download the file, you might want to regenerate the file. The CSV is a snapshot from when you clicked Generate, and could be outdated.)</td>
250
+
(If the trait recalculates between when you click Generate and when you download the file, regenerate the file. The CSV is a snapshot from when you clicked Generate, and could be outdated.)</td>
0 commit comments