Using data warehouse tables in experiments

If you have event-like data in a data warehouse table (e.g. purchases, subscriptions, usage records), you can use it directly as a metric in your experiment.

Setting up a data warehouse metric

  1. When adding a metric to your experiment, select the Data warehouse tables category and pick your table.

  2. Configure the following fields:

    FieldDescription
    Timestamp FieldThe column in your data warehouse table that contains the timestamp of each row
    Data Warehouse Join KeyThe column in your data warehouse table that identifies which user each row belongs to (e.g. user_id, email)
    Events Join KeyThe field on PostHog events to match against the data warehouse join key (usually distinct_id)

Data warehouse metric configuration showing the Timestamp Field, Data Warehouse Join Key, and Events Join Key fields
Matching users between your table and PostHog

The Data Warehouse Join Key and Events Join Key together determine how PostHog links your data warehouse rows to PostHog events. In most cases, the data warehouse join key is the column containing your user identifier, and the events join key is distinct_id. If your setup uses a different identifier (e.g. $session_id), you can adjust the events join key accordingly.

Supported metric types

Metric typeSupportedNotes
MeanYesCount, sum, average, min, max aggregations
RatioYesBoth numerator and denominator can be data warehouse tables
RetentionYesBoth start and completion events can be data warehouse tables
FunnelNoNot currently supported

Community questions

Was this page useful?

Questions about this page? or post a community question.