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/personas/computed-traits.md
+32-19Lines changed: 32 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Account-level examples:
34
34
- Total Logins by Account 30 Days
35
35
- Emails Opened by Account 90 Days
36
36
37
-

37
+

38
38
39
39
### Aggregation
40
40
@@ -48,27 +48,27 @@ Account-level use cases
48
48
- Total Minutes Watched 30 Days
49
49
- Avg Order Size Last 180 Days
50
50
51
-

51
+

52
52
53
53
### Most Frequent
54
54
55
-
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, we return 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.
55
+
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.
56
56
57
57
User-level examples:
58
58
- Favorite Blog Post
59
59
- Top Purchase Category
60
60
61
-

61
+

62
62
63
63
Account-level examples:
64
64
- Most frequent product viewed
65
65
- Most active user
66
66
67
-

67
+

68
68
69
69
### First
70
70
71
-
The first user-level trait returns the first event property value we have seen. This is common for creating traits like `first_page_visited` based on the page name. For accounts, the first computed trait could also return a trait like `first_user_signup`, to calculate the first user to use your product.
71
+
The first user-level trait returns the first event property value Segment has seen. This is common for creating traits like `first_page_visited` based on the page name. For accounts, the first computed trait could also return a trait like `first_user_signup`, to calculate the first user to use your product.
72
72
73
73
User-level examples:
74
74
- First seen timestamp
@@ -78,23 +78,23 @@ Account-level examples:
78
78
- First email opened
79
79
- First user signup
80
80
81
-

81
+

82
82
83
83
### Last
84
84
85
-
The last trait returns the last event property value we have seen. This is common for creating traits like `last_utm_campaign` to help you calculate last-touch attribution for paid advertising.
85
+
The last trait returns the last event property value Segment has seen. This is common for creating traits like `last_utm_campaign` to help you calculate last-touch attribution for paid advertising.
86
86
87
87
User-level examples:
88
88
- Last seen at
89
89
- Last utm parameter
90
90
91
-

91
+

92
92
93
93
Account-level examples:
94
94
- Last unsubscribe timestamp
95
95
- Last user active
96
96
97
-

97
+

98
98
99
99
### Unique List
100
100
@@ -105,7 +105,7 @@ Example use cases:
105
105
- Unique categories
106
106
- Unique games played
107
107
108
-

108
+

109
109
110
110
111
111
### Unique List Count
@@ -116,13 +116,13 @@ User-level examples:
116
116
- Unique products viewed count
117
117
- Unique categories count
118
118
119
-

119
+

120
120
121
121
Account-level examples:
122
122
- Unique products viewed
123
123
- Unique visitors count
124
124
125
-

125
+

126
126
127
127
## Conditions
128
128
@@ -148,13 +148,26 @@ The following operators are available.
148
148
149
149
Personas 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.
150
150
151
-
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`.
151
+
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`.
152
152
153
153
Learn more about [Computed trait generated events here](/docs/personas/using-personas-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 Personas-compatible destinations](/docs/personas/using-personas-data/#compatible-personas-destinations)
154
154
155
-

155
+

156
156
157
-
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, we 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/personas/audiences/account-audiences) for more information.
157
+
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/personas/audiences/account-audiences) for more information.
158
+
159
+
## Editing Realtime Traits
160
+
161
+
Personas supports the editing of realtime 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.
162
+
163
+
To edit a realtime Trait, follow these steps:
164
+
165
+
1. In your Personas Space, select the **Computed Traits** tab.
166
+
2. Select the realtime Trait you want to edit.
167
+
3. Select the **Builder** tab and make your edits.
168
+
4. Select **Save Computed Trait** to confirm your edits.
169
+
170
+
Personas then processes your Trait edits. While the edit task runs, the trait remains locked and you can't make further changes. Once Personas has finished incorporating your changes, you'll be able to access your updated Trait.
158
171
159
172
160
173
## Accessing your Computed Traits using the Profiles API
@@ -182,17 +195,17 @@ returns:
182
195
183
196
You can read the [full Profile API docs](/docs/personas/profile-api/) to learn more.
184
197
185
-
## Downloading your Computed Trait as a CSV
198
+
## Downloading your Computed Trait as a CSV file
186
199
187
200
You can download a copy of your trait by visiting the the computed trait overview page.
188
-

201
+

189
202
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:
190
203
-**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](files/trait_csv_format_a.csv)
191
204
-**Distinct columns for unique external IDs (with indexed columns for ID types with multiple values):** Contains the same first three columns as the unformatted CSV. Additional columns are added for each distinct external ID type. When a single row has more than one value for a given external ID type, for example a user with three email addresses, _additional columns with indexed headers are added_, (`email`, `email_1`, `email_2`). [Download example formatted CSV with indexed columns](files/trait_csv_format_b.csv)
192
205
-**Distinct columns for unique external IDs (with additional rows for ID types with multiple values):** Contains the same first three columns as the unformatted CSV. Additional columns are added for each distinct external ID type. When a single row has more than one value for a given external ID type, for example a user with two email addresses, _additional rows are added with the first three columns repeated (user or account key, trait value and external IDs JSON)._[Download example formatted CSV with additional rows](files/trait_csv_format_c.csv)
193
206
<table>
194
207
<tr>
195
-
<td></td>
208
+
<td></td>
196
209
<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.
197
210
(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>
0 commit comments