• Product
  • Pricing
  • Docs
  • Using PostHog
  • Community
  • Company
  • Login

Table of contents

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • Other platforms
      • Instance settings
      • Environment variables
      • Securing PostHog
      • Monitoring with Grafana
      • Running behind a proxy
      • Configuring email
      • Helm chart configuration
      • Deploying ClickHouse using Altinity.Cloud
      • Configuring Slack
      • Overview
        • Overview
        • Upgrade notes
        • Overview
        • 0001-events-sample-by
        • 0002_events_sample_by
        • 0003_fill_person_distinct_id2
        • ClickHouse
          • Backup
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
          • Horizontal scaling (Sharding & replication)
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Architecture
    • Managing hosting costs
    • EU-only hosting
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Libraries
    • Badge
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Browser Extensions
      • Elixir
      • Go
      • Java
      • Node.js
      • PHP
      • Python
      • Ruby
      • Docusaurus v2
      • Gatsby
      • Google Tag Manager
      • Next.js
      • Nuxt.js
      • Retool
      • RudderStack
      • Segment
      • Sentry
      • Slack
      • Shopify
      • WordPress
      • Message formatting
      • Microsoft Teams
      • Slack
      • Discord
    • To another self-hosted instance
    • To PostHog from Amplitude
    • Between Cloud and self-hosted
  • Tutorials
    • Overview
    • Actions
    • Annotations
    • Cohorts
    • Correlation Analysis
    • Dashboards
    • Data Management
    • Events
    • Experimentation
    • Feature Flags
    • Funnels
    • Group Analytics
    • Heatmaps
    • Insights
    • Lifecycle
    • Organizations and projects
    • Paths
    • Persons
    • Retention
    • Session Recording
    • Sessions
    • Settings
    • SSO & SAML
    • Stickiness
    • Subscriptions
    • Toolbar
    • Trends
    • UTM segmentation
    • Overview
    • Troubleshooting
      • Overview
      • Tutorial
      • TypeScript types
      • Developer reference
        • Amazon Kinesis Import
        • BitBucket Release Tracker
        • Braze Import
        • Event Replicator
        • GitHub Release Tracker
        • GitHub Star Sync
        • GitLab Release Tracker
        • Heartbeat
        • Ingestion Alert
        • Email Scoring
        • n8n Connector
        • Orbit Connector
        • Redshift Import
        • Segment Connector
        • Shopify Connector
        • Twitter Followers Tracker
        • Zendesk Connector
        • Airbyte Exporter
        • Amazon S3 Export
        • BigQuery Export
        • Customer.io Connector
        • Databricks Export
        • Engage Connector
        • GCP Pub/Sub Connector
        • Google Cloud Storage Export
        • Hubspot Connector
        • Intercom Connector
        • Migrator 3000
        • PagerDuty Connector
        • PostgreSQL Export
        • Redshift Export
        • RudderStack Export
        • Salesforce Connector
        • Sendgrid Connector
        • Sentry Connector
        • Snowflake Export
        • Twilio Connector
        • Variance Connector
        • Zapier Connector
        • Downsampler
        • Event Sequence Timer
        • First Time Event Tracker
        • Property Filter
        • Property Flattener
        • Schema Enforcer
        • Taxonomy Standardizer
        • Unduplicator
        • Automatic Cohort Creator
        • Currency Normalizer
        • GeoIP Enricher
        • Timestamp Parser
        • URL Normalizer
        • User Agent Populator
    • Overview
    • POST-only public endpoints
    • Actions
    • Annotations
    • Cohorts
    • Dashboards
    • Event definitions
    • Events
    • Experiments
    • Feature flags
    • Funnels
    • Groups
    • Groups types
    • Insights
    • Invites
    • Members
    • Persons
    • Plugin configs
    • Plugins
    • Projects
    • Property definitions
    • Session recordings
    • Trends
    • Users
    • Data model
    • Overview
    • GDPR guidance
    • HIPAA guidance
    • CCPA guidance
    • Data egress & compliance
  • Support
    • Overview
    • Code of conduct
    • Recognizing contributions

Table of contents

  • Overview
    • Quickstart with PostHog Cloud
    • Overview
      • AWS
      • Azure
      • DigitalOcean
      • Google Cloud Platform
      • Hobby
      • Other platforms
      • Instance settings
      • Environment variables
      • Securing PostHog
      • Monitoring with Grafana
      • Running behind a proxy
      • Configuring email
      • Helm chart configuration
      • Deploying ClickHouse using Altinity.Cloud
      • Configuring Slack
      • Overview
        • Overview
        • Upgrade notes
        • Overview
        • 0001-events-sample-by
        • 0002_events_sample_by
        • 0003_fill_person_distinct_id2
        • ClickHouse
          • Backup
          • Kafka Engine
          • Resize disk
          • Restore
          • Vertical scaling
          • Horizontal scaling (Sharding & replication)
        • Kafka
          • Resize disk
          • Log retention
        • PostgreSQL
          • Resize disk
          • Troubleshooting long-running migrations
        • Plugin server
        • MinIO
        • Redis
        • Zookeeper
      • Disaster recovery
    • Troubleshooting and FAQs
    • Architecture
    • Managing hosting costs
    • EU-only hosting
    • Overview
    • Ingest live data
    • Ingest historical data
    • Identify users
    • User properties
    • Deploying a reverse proxy
    • Libraries
    • Badge
      • Snippet installation
      • Android
      • iOS
      • JavaScript
      • Flutter
      • React Native
      • Browser Extensions
      • Elixir
      • Go
      • Java
      • Node.js
      • PHP
      • Python
      • Ruby
      • Docusaurus v2
      • Gatsby
      • Google Tag Manager
      • Next.js
      • Nuxt.js
      • Retool
      • RudderStack
      • Segment
      • Sentry
      • Slack
      • Shopify
      • WordPress
      • Message formatting
      • Microsoft Teams
      • Slack
      • Discord
    • To another self-hosted instance
    • To PostHog from Amplitude
    • Between Cloud and self-hosted
  • Tutorials
    • Overview
    • Actions
    • Annotations
    • Cohorts
    • Correlation Analysis
    • Dashboards
    • Data Management
    • Events
    • Experimentation
    • Feature Flags
    • Funnels
    • Group Analytics
    • Heatmaps
    • Insights
    • Lifecycle
    • Organizations and projects
    • Paths
    • Persons
    • Retention
    • Session Recording
    • Sessions
    • Settings
    • SSO & SAML
    • Stickiness
    • Subscriptions
    • Toolbar
    • Trends
    • UTM segmentation
    • Overview
    • Troubleshooting
      • Overview
      • Tutorial
      • TypeScript types
      • Developer reference
        • Amazon Kinesis Import
        • BitBucket Release Tracker
        • Braze Import
        • Event Replicator
        • GitHub Release Tracker
        • GitHub Star Sync
        • GitLab Release Tracker
        • Heartbeat
        • Ingestion Alert
        • Email Scoring
        • n8n Connector
        • Orbit Connector
        • Redshift Import
        • Segment Connector
        • Shopify Connector
        • Twitter Followers Tracker
        • Zendesk Connector
        • Airbyte Exporter
        • Amazon S3 Export
        • BigQuery Export
        • Customer.io Connector
        • Databricks Export
        • Engage Connector
        • GCP Pub/Sub Connector
        • Google Cloud Storage Export
        • Hubspot Connector
        • Intercom Connector
        • Migrator 3000
        • PagerDuty Connector
        • PostgreSQL Export
        • Redshift Export
        • RudderStack Export
        • Salesforce Connector
        • Sendgrid Connector
        • Sentry Connector
        • Snowflake Export
        • Twilio Connector
        • Variance Connector
        • Zapier Connector
        • Downsampler
        • Event Sequence Timer
        • First Time Event Tracker
        • Property Filter
        • Property Flattener
        • Schema Enforcer
        • Taxonomy Standardizer
        • Unduplicator
        • Automatic Cohort Creator
        • Currency Normalizer
        • GeoIP Enricher
        • Timestamp Parser
        • URL Normalizer
        • User Agent Populator
    • Overview
    • POST-only public endpoints
    • Actions
    • Annotations
    • Cohorts
    • Dashboards
    • Event definitions
    • Events
    • Experiments
    • Feature flags
    • Funnels
    • Groups
    • Groups types
    • Insights
    • Invites
    • Members
    • Persons
    • Plugin configs
    • Plugins
    • Projects
    • Property definitions
    • Session recordings
    • Trends
    • Users
    • Data model
    • Overview
    • GDPR guidance
    • HIPAA guidance
    • CCPA guidance
    • Data egress & compliance
  • Support
    • Overview
    • Code of conduct
    • Recognizing contributions
  • Docs
  • Manuals
  • Sessions

Sessions

Last updated: Aug 01, 2022

On this page

  • What is a session?
  • Common questions
  • Session analysis
  • Session counts
  • Using session counts in formulas
  • Filtering by session duration
  • Plotting session duration
  • Distribution of session duration

Session analysis helps you to understand product usage by uncovering the amount of time users spend on your product and how often they return.

This helps you to understand which of your features drive the most engagement and how to improve your product.

What is a session?

A session is a set of events that have been grouped together to try to capture a single "use" of your product.

As events are sent to PostHog, they are grouped into sessions on the client. If there isn't activity for more than 30 minutes, then the session is ended, and the subsequent events are grouped into a new session.

Common questions

  • Can a session span different devices?: No, sessions are tied to a single device and instance of a PostHog client. This means if a user is using two different browsers (e.g. Chrome and Firefox) they will be treated as two separate sessions.
  • Can a session span browser tabs and windows?: Yes, as a user moves between different tabs and windows, their events will be grouped into a single session. However, if they open a completely new browser (e.g. move from Chrome to Firefox) then a new session will be created.
  • Which clients support sessions?: Today, PostHog-JS is the only client that supports sessions. However, we are planning to add it to the other front-end libraries.
  • How are sessions split?: Sessions are split when there is no user activity for more than 30 minutes.
  • What defines user activity for a session?: User activity is defined as any event sent from the client (including Autocapture events). Also, if recordings are enabled, then user activity from the recording (like mouse movement) will extend the session.
  • Is there a limit on session length?: Yes, the longest allowed session is 24 hours. If a session is longer than that, it will be split.
  • Is a session the same as a recording?: Both sessions and recordings are tracked using the same ID. So if a new session is created, then a new recording is created too.

Session analysis

Within the trends tab of insights, you can analyze sessions along with your other data.

IMPORTANT: When performing session analysis, PostHog will only include events that have been been tagged with a session. Right now, that is only posthog-js events sent from version 1.16.1 (released Nov. 7 2021) and later.

Session counts

Within the trends tab, you can aggregate results by the count of unique sessions. This provides the count of unique sessions where the specified event occurred. If you have specific events that are sent a bunch of times within a single session, this can be helpful to remove the noise.

To do this analysis, simply select Unique sessions from the aggregation dropdown.

Session counts

Using session counts in formulas

Combining session counts with other trends is a very powerful way to understand things like:

  • The average number of sessions per user where a specific action occurs
  • The average number of a specific events per session

To do this analysis, simply make the series in your trends (e.g. unique sessions where an event occurs), and then use that series in a formula.

Session counts

Filtering by session duration

Sometimes, it can be helpful to filter out sessions that are either too short or too long. For example, this enables you to dig into users who only use your product for a few seconds, or filter those users out, so you can better understand those who stick around longer.

To accomplish this, you can use the 'Session duration' property in the property filters.

Session counts

Plotting session duration

You can plot session durations overtime to understand if your users are becoming more or less engaged with your product. To accomplish this, select one of the property aggregators (e.g median, 90th percentile etc) and then select 'Session duration' as the property to plot.

Session counts

Distribution of session duration

Breaking down data by the distribution of session durations can be useful when trying to understand why certain users behave a specific way. For example, you might find that users who complete a specific event are always in your product for over 10 minutes.

To look at the distribution of session durations, click 'Add breakdown' and then select the 'Session duration' property.

Session counts

Questions?

Was this page useful?

Next article

Settings & Billing

This page documents all settings within the PostHog application . If you are self-hosting PostHog, a guide to configuring your instance settings can be found here . Organization settings - covers your entire organization Billing - covers your entire organization Project settings - affect your current project only My settings - affect the current user that is logged in only Organization settings Open your account dropdown in the top right corner of the navigation bar and then click on…

Read next article

Authors

  • pjhul
    pjhul
  • Rick Marron
    Rick Marron
  • Charles Cook
    Charles Cook

Share

Jump to:

  • What is a session?
  • Common questions
  • Session analysis
  • Session counts
  • Using session counts in formulas
  • Filtering by session duration
  • Plotting session duration
  • Distribution of session duration
  • Questions?
  • Edit this page
  • Raise an issue
  • Toggle content width
  • Toggle dark mode
  • About
  • Blog
  • Newsletter
  • Careers
  • Support
  • Contact sales

Product OS suite

Product overview

Analytics
  • Funnels
  • Trends
  • Paths

Pricing

Features
  • Session recording
  • Feature flags
  • Experimentation
  • Heatmaps

Customers

Platform
  • Correlation analysis
  • Collaboration
  • Apps

Community

Discussion
  • Questions?
  • Slack
  • Issues
  • Contact sales
Get involved
  • Roadmap
  • Contributors
  • Merch
  • PostHog FM
  • Marketplace

Docs

Getting started
  • PostHog Cloud
  • Self-hosted
  • Compare options
  • Tutorials
  • PostHog on GitHub
Install & integrate
  • Installation
  • Docs
  • API
  • Apps
User guides
  • Cohorts
  • Funnels
  • Sessions
  • Data
  • Events

Company

About
  • Our story
  • Team
  • Handbook
  • Investors
  • Careers
Resources
  • FAQ
  • Ask a question
  • Blog
  • Press
  • Merch
  • YouTube
© 2022 PostHog, Inc.
  • Code of conduct
  • Privacy
  • Terms