Understanding PostHog

Last updated:

|Edit this page

PostHog is a lot of power, so to get the most from it, we should review how data is structured, grouped, and related.

PostHog data flow

Events

PostHog’s data model starts with events, single actions that a user triggered at a specific point in time. These are sent either from one of our SDKs or directly via our API.

Events are flexible: they can be captured automatically, via autocapture, or you can emit your own custom events, attaching additional metadata via properties.

You might create an event to represent purchasing an upgrade, with custom properties like price or renewal_period.

Actions

Actions are a layer on top of events. Define actions to aggregate multiple events, extract a specific kind of event according to its properties, or give an event a more useful name.

Sessions

A session is a stream of events corresponding to a specific usage session of a product. Sessions have properties, and you can query them.

Person profiles

Meanwhile, users of your product are given a person profile, which gather these events. Person profiles similarly contain properties. Some are set automatically:

  • browser details
  • geo IP data
  • referrers
  • UTM values

You can also set your own properties on person profiles, which will appear in reports and data tables.

If a user upgrades to a paid tier, for example, you could set a property called paid_tier with the details.

Person profiles need distinct identifiers, so PostHog can accurately track behavior. You might see a few identifiers on each profile: anonymous IDs created before a user has been identified, an ID you set after they log in, and IDs that are created on the client and backend, later merged together into a single profile.

Displaying and organizing data

To make sense of the many events and person profiles flowing through your product, use:

Insights to create charts, tables and more that summarize your data.

Dashboards to assemble insights into a cohesive, customizable view.

Notebooks to contextualize insights and share analysis with your teammates.

Discovering activity with cohorts and groups

You can create ongoing queries to surface person profiles either according to their properties, or the details of their events. We call these cohorts. If you want to see a list of every user in your paid tier, you could query for all profiles where that paid_tier property has been set. Your cohort would then show you a periodically-updated listing of your paid customers.

Alternatively, you might want to understand group behavior. By defining groups, you can see a cross-section of events across multiple person profiles. This can be helpful if you’re selling to multi-seat customers, and want to understand the overall behavior of their users.

Groups require that you have the Group analytics add-on and that you enable person profiles.

Data model

Dig into the data model to learn more about the fields on each data type.

Questions? Ask Max AI.

It's easier than reading through 585 docs articles.

Community questions

Was this page useful?

Next article

Install PostHog

Tip : If you have multiple customer-facing products (e.g. a marketing website + iOS app + web app), it's best to install PostHog on them all and group them in one project . This way you can track the user across their entire journey.

Read next article