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
docs: Clarify cohort usage in test account filters for CDP destinations (#16234)
* docs(cohorts): add CDP destination compatibility note for cohort filters
Based on PR #53333, which clarified that:
- Person-property-only cohorts work in CDP destinations (inlined automatically)
- Behavioral/empty cohorts cause CDP destination errors
- All cohort types work fine for analytics queries
* Update filter-internal-users tutorial to clarify cohort behavior in CDP destinations
Reflects changes from PostHog/posthog#53333: person-property-only cohorts
work in CDP destinations (inlined automatically), but behavioral cohorts
or empty cohorts cause errors. Inline person property filters work everywhere.
---------
Co-authored-by: inkeep[bot] <257615677+inkeep[bot]@users.noreply.github.com>
Cohorts enable you to easily create a list of users who have something in common, such as completing an [action](/docs/data/actions) or having the same [property](/docs/product-analytics/person-properties).
@@ -48,7 +52,7 @@ Here are a few examples of the cohorts you can create:
48
52
49
53
Your cohorts are available in the [People](https://us.posthog.com/persons) page under the [Cohorts](https://us.posthog.com/cohorts) tab.
50
54
51
-
> **Note:** Cohorts rely on [person properties](/docs/product-analytics/person-properties), so you need to capture identified events to create them.
55
+
> **Note:** Cohorts rely on [person properties](/docs/product-analytics/person-properties), so you need to capture identified events to create them.
52
56
53
57
## Where can you use cohorts?
54
58
@@ -61,6 +65,9 @@ You can use cohorts in many different ways, such as:
61
65
- To filter the session replay list and create playlists
62
66
- Filter live events on the [activity page](/docs/activity)
63
67
- Filter users on the People page
68
+
- To [filter out internal and test users](/tutorials/filter-internal-users) in test account filters
69
+
70
+
> **Note:** Cohorts used in [CDP](/docs/cdp) destination filters must contain **exclusively person property filters**. Person-property-only cohorts are automatically inlined and work in real-time CDP destinations. Cohorts with behavioral filters or no properties defined will cause CDP destinations to error. All cohort types work for analytics queries (insights, dashboards).
64
71
65
72
You can use cohorts to answer questions like:
66
73
@@ -75,11 +82,10 @@ Cohorts are sometimes confused with [groups](/docs/product-analytics/group-analy
75
82
-**Cohorts** represent a specific set of users – e.g., a list of users whose email contains a certain string (like a company's domain).
76
83
77
84
-**Groups** aggregate events based on entities, such as organizations or companies, but do not necessarily connect to a user. They enable you to analyze trends, insights, and dashboards at an entity-level (like a company or organization), as opposed to a user-level.
78
-
79
-
If your only goal is to create a **list of users** with something in common, we recommend cohorts instead of groups.
80
85
81
-
Groups require additional code in your app to set up, while cohorts are created in PostHog and don't require additional code. This makes cohorts easier to use and quicker to get started.
86
+
If your only goal is to create a **list of users** with something in common, we recommend cohorts instead of groups.
82
87
88
+
Groups require additional code in your app to set up, while cohorts are created in PostHog and don't require additional code. This makes cohorts easier to use and quicker to get started.
83
89
84
90
## How to create a cohort
85
91
@@ -89,7 +95,7 @@ Once you've captured identified events, there are two ways to create a new cohor
89
95
90
96
You can create cohorts using data from insights such as trends, [funnels](/docs/product-analytics/funnels), [user paths](/docs/product-analytics/paths) and [lifecycles](/docs/product-analytics/lifecycle).
91
97
92
-
1. Go to [insights](https://us.posthog.com/insights) and open any insight that's aggregated at a user-level, like `unique users` or `weekly active user`.
98
+
1. Go to [insights](https://us.posthog.com/insights) and open any insight that's aggregated at a user-level, like `unique users` or `weekly active user`.
93
99
94
100
2. Click a data point in the visualization to view the [persons](/docs/data/persons) represented in the underlying data.
95
101
@@ -98,10 +104,10 @@ You can create cohorts using data from insights such as trends, [funnels](/docs/
98
104
The video below shows how to create a new cohort from a trend, although you can similarly create a cohort from a funnel, user path, or any other insight.
99
105
100
106
<ProductVideo
101
-
videoLight={createCohortLight}
102
-
videoDark={createCohortDark}
103
-
alt="How to create a cohort from a trend"
104
-
classes="rounded"
107
+
videoLight={createCohortLight}
108
+
videoDark={createCohortDark}
109
+
alt="How to create a cohort from a trend"
110
+
classes="rounded"
105
111
/>
106
112
107
113
### Method 2: Create a new cohort from the cohorts page
@@ -111,10 +117,10 @@ The video below shows how to create a new cohort from a trend, although you can
111
117
2. Click **+ New Cohort** on the top right.
112
118
113
119
<ProductScreenshot
114
-
imageLight={cohortsPageLight}
115
-
imageDark={cohortsPageDark}
116
-
alt="left hand navigation for cohorts"
117
-
classes="rounded"
120
+
imageLight={cohortsPageLight}
121
+
imageDark={cohortsPageDark}
122
+
alt="left hand navigation for cohorts"
123
+
classes="rounded"
118
124
/>
119
125
120
126
## Static and dynamic cohorts
@@ -129,7 +135,7 @@ You have two options when creating a cohort:
129
135
130
136
Static cohorts are created from insights, by uploading a CSV of users, or by duplicating a dynamic cohort.
131
137
132
-
When creating cohorts from CSVs, the [person profile](/docs/data/persons) associated with each row must already exist in PostHog.
138
+
When creating cohorts from CSVs, the [person profile](/docs/data/persons) associated with each row must already exist in PostHog.
133
139
134
140
You can identify users using either:
135
141
@@ -210,12 +216,12 @@ Dynamic cohorts can be based on existing cohorts, and support the following crit
210
216
211
217
#### Behavioral
212
218
213
-
|**Event or action**|**Example**|
214
-
| --- | --- |
215
-
| Completed event or action | Completed `user signed up` in the last 30 days |
216
-
| Did not complete event or action | Did not complete `user signed up` in the last 2 months |
217
-
| Completed event or action multiple times | Completed `watched video` 5 times in the last 2 weeks |
218
-
| Completed a sequence of events or actions | Completed `user signed up` in the last 5 days followed by `watched video` within 1 day of the initial event |
| Completed event or action | Completed `user signed up` in the last 30 days|
222
+
| Did not complete event or action | Did not complete `user signed up` in the last 2 months|
223
+
| Completed event or action multiple times | Completed `watched video` 5 times in the last 2 weeks|
224
+
| Completed a sequence of events or actions | Completed `user signed up` in the last 5 days followed by `watched video` within 1 day of the initial event|
219
225
| Did not complete a sequence of events or actions | Did not complete `user signed up` in the last 5 days followed by `watched video` within 1 day of the initial event |
220
226
221
227
You can select `days`, `weeks`, `months` or `years` time ranges here.
@@ -224,27 +230,27 @@ You can select `days`, `weeks`, `months` or `years` time ranges here.
224
230
225
231
Has or doesn't have a person property with the following operators:
226
232
227
-
|**Operator**|**Example**|
228
-
| --- | --- |
229
-
|`equals` or `does not equal`|`Pineapple on pizza` property `does not equal` "true" |
230
-
|`contains` or `does not contain`|`email` property `does not contain` "gmail", "yahoo", "hotmail" |
231
-
|`matches regex` or `does not match regex`|`Country code` property `matches regex` "us\|uk\|aus" |
232
-
|`greater than` or `greater than or equal to`|`Age` property `greater than` "21" |
233
-
|`less than` or `less than or equal to`|`Age` property `less than or equal to` "21" |
234
-
|`is set` or `is not set`|`UTM Source` property `is not set`|
235
-
|`between` or `not between`|`Age` property is between "18" and "30" |
236
-
|`minimum` or `maximum` value |`Organization size` property has a `minimum` of "5" |
|`equals` or `does not equal`|`Pineapple on pizza` property `does not equal` "true"|
236
+
|`contains` or `does not contain`|`email` property `does not contain` "gmail", "yahoo", "hotmail" |
237
+
|`matches regex` or `does not match regex`|`Country code` property `matches regex` "us\|uk\|aus"|
238
+
|`greater than` or `greater than or equal to`|`Age` property `greater than` "21" |
239
+
|`less than` or `less than or equal to`|`Age` property `less than or equal to` "21"|
240
+
|`is set` or `is not set`|`UTM Source` property `is not set`|
241
+
|`between` or `not between`|`Age` property is between "18" and "30"|
242
+
|`minimum` or `maximum` value |`Organization size` property has a `minimum` of "5"|
237
243
238
244
For a complete list of all available operators, including semver operators for version-based filtering, see the [property filter operators reference](/docs/data/property-filters).
239
245
240
246
#### Lifecycle
241
247
242
-
|**Criteria**|**Example**|
243
-
| --- | --- |
244
-
| Completed an event for first time | Completed `shared insight` event for the first time in the "last 30 days" |
245
-
| Completed an event regularly | Completed `shared insight` at least "3 times per week" for at least "3 of the last 5 periods" |
246
-
| Stopped doing an event | Stopped doing `shared insight` event in the "last 5 days" but had done it in the "5 days prior" |
247
-
| Started doing event again | Started doing `shared insight` event in the "last 5 days" but had not done it in the "5 days prior" |
| Completed an event for first time | Completed `shared insight` event for the first time in the "last 30 days" |
251
+
| Completed an event regularly | Completed `shared insight` at least "3 times per week" for at least "3 of the last 5 periods"|
252
+
| Stopped doing an event | Stopped doing `shared insight` event in the "last 5 days" but had done it in the "5 days prior"|
253
+
| Started doing event again | Started doing `shared insight` event in the "last 5 days" but had not done it in the "5 days prior" |
248
254
249
255
You can select `days`, `weeks`, `months` or `years` time ranges here.
250
256
@@ -257,11 +263,11 @@ Dynamic cohorts are updated once every 24 hours.
257
263
### Can you use a dynamic cohort as a feature flag target?
258
264
259
265
You cannot use dynamic cohorts that include behavioral or lifecycle criteria as a feature flag target. To target these dynamic cohorts for a feature flag, A/B test, or survey, you must first duplicate them into a static cohort. Dynamic cohorts with only person property criteria can be used.
260
-
261
-
### Can you use groups in cohorts?
262
-
263
-
Not yet, but we are working on [rewriting cohort calculations in SQL](/teams/product-analytics#goals) which will unlock your ability to do this.
264
-
266
+
267
+
### Can you use groups in cohorts?
268
+
269
+
Not yet, but we are working on [rewriting cohort calculations in SQL](/teams/product-analytics#goals) which will unlock your ability to do this.
270
+
265
271
### Further reading
266
272
267
273
-[How to track new and returning users in PostHog](/tutorials/track-new-returning-users)
0 commit comments