Cohorts are PostHog's way of letting you easily create a list of users who have something in common.
You can use the cohorts to:
- View a list of users who all did the same action or have the same property. A few examples of how you might use this are:
- "Which users used the app today?"
- "Which users work at the same company?"
- "Who used the app once but never came back?"
- Segment other statistics. For example, to view user paths or action trends. This let's you understand things like:
- "Are people at company X using the app much?"
- "Is the number of Daily Active Users going up or down over time?"
Creating a new cohort
Step 1: Navigate to the 'People' page:
Step 2: Click '+ New Cohort' on the top left.
There are three key settings for a cohort: 'action', 'property', and 'New group'. See below:
'New group' adds another group of filters that a user must match to be a part of the cohort, as an
OR operation. This means that if a user matches any of the groups you add, they will be added to the cohort.
Group users by actions
You can group users who have performed certain actions. You need to already have configured actions for that to work.
Group users by property
You can also group users who have a certain property in common. Commonly, this used to combine users at a certain team, from a certain marketing campaign (via their UTM tags), or whatever other static property you need:
Adjusting time frames
You may only want users who have performed a certain action within a certain timeframe.
On setting the cohort to 'user has action', you will be presented with the following:
Currently, our time filtering for cohorts has 3 options, but we are working to expand this functionality.
Viewing users in a cohort
Go to 'People' > 'Cohorts' in the left-hand navigation (as shown in the beginning of this page) and select the cohort you want to view by clicking it, and you'll be presented with a list
Differentiating team vs. users traffic
From the initial setup, PostHog is tracking various events from all users. However, you may want to differentiate between traffic from your team and traffic from your users.
To do so, you can identify your team members in PostHog either through a
posthog.identify (e.g. by setting an email as the ID) call or by associating properties with your team member users (e.g.
is_team = true).
With that done, you can then create a cohort of your team and/or a cohort that does not include any of your team members, so that you can continue to gather data on all users, but can differentiate between them when performing your analytics processes.
This is the recommended method for differentiating between team and user traffic if you want to keep receiving events. However, if you wish to stop receiving events on your team altogether, you should consider using