Last updated:

Where is this feature available?

Self-hosted plans
  • Open-source
  • Scale
  • Enterprise
Cloud plans
  • Free
  • Startup
  • Standard
  • Enterprise

Recordings allows you to record users navigating through your website and play back the individual sessions to watch how real users use your product.

Recording example

Using recordings

Recordings can only be used with our JavaScript library and requires the feature to be enabled in PostHog's Project Settings (/project/settings). Once enabled, the JS library will start recording sessions by default.

Please note recordings does not work if you send data using Segment's SDK as this data is not collected. If you use Segment, you may want to add the PostHog library too (make sure to only send regular event data from one source).

Recordings can be toggled on and off in the JS library by appropriately setting the config. Users who opt out of event capturing will not have their sessions recorded.

To watch recordings, you can either visit the 'Recordings' page or click on any data point in an insight and from the list of persons related to that data point. This is specially useful in funnels, where you can watch recordings of users who converted or dropped off.

When watching recordings, you can change the speed as well as select the option 'skip inactive' - this will skip chunks of the recording where the user was inactive on the page.

Ignoring sensitive elements

If recording your application may capture sensitive user information, you need to update your codebase to prevent PostHog from capturing this during session recordings.

To do so, you should add the CSS class name ph-no-capture to elements which should not be recorded. This will lead to the element being replaced with a block of the same size when you play back the recordings. Make sure everyone who watches recordings in your team is aware of this, so that they don't think your product is broken when something doesn't show up!

Additionally, when dealing with inputs, if you wish to still capture the input box but not its contents, you can use the class name ph-ignore-input instead.

Recordings data retention

Depending on how your app/website is built, recordings can take a lot of disk space. To manage this, we have the following retention policy options in place.

PostHog Cloud & Clickhouse Self-hosted

By default, recordings are automatically deleted after 3 weeks. Old recordings are deleted with Clickhouse's Table TTL. If you're self-hosting, you can set your own retention policy by executing a query like this on your Clickhouse instance.

ALTER TABLE session_recording_events TTL toDate(created_at) + INTERVAL 6 WEEK

Legacy Postgres Self-hosted

Recordings are kept indefinitely by default. You can can set recordings to delete after a configurable number of days in the project settings page.

Preserving recordings

We're working towards a solution for archiving and preserving recordings data for future reference. You can follow up on this GitHub issue.

Further controls

If you want more granular controls, you can choose to enable session recording using feature flags. This enables you to control session recordings based on users with certain previous events/actions or properties (or just to capture a percentage of all sessions).

To do this, default session recording to false, by setting disable_session_recording in our JavaScript library config, and then conditionally call the method to enable it using the feature flag. The method is posthog.startSessionRecording.

Ask a question