Downsampler

Last updated:

|Edit this page

Note: We do not recommend using the downsampler to lower the number of events ingested by PostHog. Instead, we have guide you can use to capture fewer unwanted events.

This transformation enables you to reduce how many events a deployment of PostHog will ingest. This is especially useful for users who have huge volumes of data, but don't need to analyze it all and want to avoid large bills.

Requirements

Using this requires either PostHog Cloud with the data pipeline add-on, or a self-hosted PostHog instance running version 1.30.0 or later.

Self-hosting and not running 1.30.0? Find out how to update your self-hosted PostHog deployment.

Installation

  1. In PostHog, click the "Data pipeline" tab in the left sidebar.
  2. Search for 'Downsampling' and select the transformation, press Install.
  3. Follow the on-screen steps to configure the transformation.

Configuration

OptionDescription
% of events to keep
Type: string
Required: False
Reduces events flowing in to the percentage value above
Sampling method
Type: choice
Required: False
Distinct ID aware sampling will sample based on distinct IDs, meaning that a user's events will all be ingested or all be dropped at a given sample percentage.

FAQ

Is the source code for this transformation available?

PostHog is open-source and so are all transformation on the platform. The source code for the Downsampler transformation is available on GitHub.

Who created this transformation?

We'd like to thank PostHog team members Michael Matloka and Marius Andra and Neil Kakkar for creating the Downsampler.

Who maintains this?

This is maintained by PostHog. If you have issues with it not functioning as intended, please let us know!

What if I have feedback on this destination?

We love feature requests and feedback. Please tell us what you think..

What if my question isn't answered above?

We love answering questions. Ask us anything via our community forum.

Questions?

Was this page useful?

Next article

Event Sequence Timer

You can still analyze the timing of event sequences using HogQL . For example, to get the average time between a $pageview and $pageleave events this year, create an SQL insight and use the following SQL statement: This can be customized with different events or properties. See an example use case in our “ How to calculate time on page ” tutorial. If there is functionality around event sequence timing you want but don’t see a way to do, let us know by asking a question in our community…

Read next article