People

Last updated:

|Edit this page

People in PostHog represent the users behind your events. You can view them in the People tab.

People have person properties, which enables you do things like:

  • Filter on person properties
  • Create cohorts
  • Use person properties for targeting feature flags, A/B tests, and surveys.
  • Track initial UTM values and referrers across anonymous and identified users.
  • Query the persons table using SQL insights

People and person profiles

Using people in PostHog requires capturing events with person profiles. Person profiles are how PostHog attributes events and properties to specific users. Examples of scenarios where you want to capture events with person profiles are:

  • Tracking logged-in users in B2B and B2C SaaS apps
  • Doing user segmented product analysis
  • Growth and marketing teams wanting to analyze the complete conversion lifecycle

On the other hand, there are many use cases that don't require person profiles, such as:

  • Tracking a marketing website
  • Content-focused sites
  • B2C apps where users don't sign up or log in
  • High volume API server events

Under our current pricing, events without person profiles can be up to 4x cheaper than events with them (due to computer cost of processing them), so it's recommended to only capture events with person profiles when needed.

Capturing person profiles

For backward compatibility, PostHog captures events with person profiles by default. To change this in the JavaScript Web SDK, change the person_profiles config option:

  1. person_profiles: 'always' (default) - We capture person profiles for all events.

  2. person_profiles: 'identified_only' (recommended) - We only capture person profiles for users where they are already created. This is triggered by calling functions like identify(), group(), and more. New anonymous users won't get person profiles.

An example of an updated configuration looks like this:

Web
posthog.init(
'<ph_project_api_key>',
{
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only'
}
)

Other SDKs and the API can pass the $process_person_profile property in events. Again, person profiles are enabled by default, but you can disable this by setting the property to false.

Below is an example in Node, but the same applies to other SDKs:

Node.js
client.capture({
distinctId: 'distinct_id_of_the_user',
event: 'movie_played',
properties: {
$process_person_profile: false,
},
})

Person profiles and distinct IDs

Below is good information to know when working with distinct IDs and person profiles:

  • Every event has a distinct_id representing a user attached to it. However, not every distinct_id has an associated person profile.

  • If a distinct ID already has a person profile created, any events captured with this distinct ID are considered events with a person profile.

    • To opt out of this behavior, contact file a support ticket via the in-app modal.
  • Any distinct_id created before May 2024 will have a person profile created for them. This means all of their events will be counted as events with person properties.

Viewing person profiles

Clicking on a person in the People tab opens their profile and shows all their properties.

Person profile
  • Events shows all the events a person has triggered, which you can search and filter to find specific events.

  • Recordings shows all of the session replays a person has generated. Note this is subject to the retention policy of your plan, so people who haven't been active recently may have none.

  • Cohorts shows all the cohorts a person belongs to.

  • Related groups: shows groups (e.g. organizations, projects, and instances) a person belongs to.

  • Feature flags: shows all feature flags that are enabled for the person.

  • History: shows any manual changes that have been made to the person's profile.

Deleting person data

In the PostHog app

  • Search for the person via their unique ID. For example, their email.
  • Click on the person's ID
  • Click Delete person to remove them and all their associated data. You will be prompted to confirm this action.

Via the API

You can also delete persons data via the API. See the Data Deletion docs for more information.

Questions?

Was this page useful?

Next article

Sessions

A session is a set of events that try to capture a single use of your product or visit to your website. They are used in multiple areas of PostHog: Session replays Web analytics Session aggregations Session properties Sessions enable you to analyze how exactly users are using your product, their entry and exit points, how long they spend on your site, how active they are, bounce rate, and more. How does PostHog define a session? Our JavaScript Web library and mobile SDKs (Android, iOS, React…

Read next article