> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Statsig

> Query Statsig experiment results, feature gates and metric values live from Explore and AI agents

The Statsig [live source](https://docs.lightdash.com/integrations/live-sources) reads the experiments, Pulse results, feature gates, metric values and recent events of one Statsig project, as Statsig computes them.

## Before you start

* **A Console API key**, from **Project Settings** → **API Keys** in Statsig. A personal Console API key on a read-only role is safest, since a project Console API key can also make changes. Server and client SDK keys don't work.

## Connect Statsig

[Add a live source](https://docs.lightdash.com/integrations/live-sources/set-up-and-manage.md#connect-a-live-source), select **Statsig**, and enter the **Console API key**.

![The Add Statsig source dialog with a Console API key field and a Test button under Authentication, and Name and Explore prefix under Details](https://mintcdn.com/lightdash/p6p6yvVZKOCHt5rC/images/integrations/live-sources/statsig-config.png?fit=max\&auto=format\&n=p6p6yvVZKOCHt5rC\&q=85\&s=f0f4f2625978392f46921e1e628dc0df)

## Semantic layer

Statsig computes every number, so each row is what Statsig returns and the explores have no metrics.

### Experiments

This explore lists the experiments of one Statsig project, one row for each experiment. Dates are in UTC

| Field | Description |
| - | - |
|  Experiment ID | This is the experiment's ID, its name in lowercase with underscores. Experiment results and Experiment exposures are filtered by it |
|  Name | This is the experiment's display name |
|  Status | This is the status of the experiment: `setup`, `active`, `decision_made`, `abandoned`, `archived`, `experiment_stopped` or `assignment_stopped` |
|  ID type | This is the unit the experiment randomizes, such as `userID` or `stableID` |
|  Hypothesis | This is the statement the experiment tests |
|  Description | This is the description of the experiment |
|  Team | This is the team that owns the experiment, on Enterprise plans |
|  Tags | These are the experiment's tags, joined with commas |
|  Creator | This is the name of the person who created it |
|  Created | This is the day the experiment was created, in UTC |
|  Last modified | This is the day the experiment was last changed, in UTC |
|  Started | This is the day the experiment started, in UTC. It is empty before it starts |
|  Ended | This is the day the experiment ended, in UTC. It is empty while it runs |
|  Control group ID | This is the ID of the experiment's control group |
|  Targeting gate ID | This is the ID of the feature gate a unit must pass to join the experiment |
|  Primary metrics | These are the names of the experiment's primary metrics, joined with commas |
|  Health check status | This is the overall result of Statsig's health checks: `PASSED`, `FAILED`, `WAITING`, `WARNING` or `NOT_APPLIED` |
|  Stale | This says whether Statsig considers the experiment stale, for example in progress and not changed in 30 days |
|  URL | This is the link to the experiment in Statsig |
|  Allocation | This is the percent of its layer that the experiment is allocated |
|  Planned duration | This is the planned length of the experiment in days. It is empty when the experiment ends at a target number of exposures |
|  Target exposures | This is the number of exposures that ends the experiment, when it has one |

### Experiment results

This explore reads Statsig's Pulse results for one experiment: one row for each test group and metric, compared with the control group. Statsig computes every number

| Field | Description |
| - | - |
|  Experiment ID | This is the experiment's ID. A query needs a filter on it with one experiment |
|  Results date | This is the day of the results. Without a filter, the results cover the whole experiment |
|  Test group | This is the name of the test group |
|  Test group ID | This is the ID of the test group |
|  Control group | This is the name of the experiment's control group, which each test group is compared with |
|  Control group ID | This is the ID of the control group |
|  Metric ID | This is Statsig's ID of the metric, its name and type |
|  Metric | This is the name of the metric |
|  Metric role | This says how the experiment uses the metric: `primary`, `secondary` or `other` |
|  Desired direction | This is the direction the metric should move: `increase` or `decrease` |
|  Result error | This says why Statsig has no numbers for the metric, such as `no_data`. It is empty when there are numbers |
|  Sequential test decision | This is the decision of the sequential probability ratio test: `alternative` (significant), `null` or `continue` |
|  Sequential test direction | This says whether the sequential test's decision is `positive`, `negative` or `neutral` for the metric's desired direction |
|  Test mean | This is the metric's mean in the test group |
|  Control mean | This is the metric's mean in the control group |
|  Test units | This is the number of units in the test group |
|  Control units | This is the number of units in the control group |
|  Absolute change | This is the test mean minus the control mean, in the metric's unit |
|  Percent change | This is the change of the test group against control, in percent |
|  Confidence interval lower | This is the lower bound of the absolute change's confidence interval |
|  Confidence interval upper | This is the upper bound of the absolute change's confidence interval |
|  Percent confidence interval lower | This is the lower bound of the percent change's confidence interval, in percent |
|  Percent confidence interval upper | This is the upper bound of the percent change's confidence interval, in percent |
|  P-value | This is the p-value of the change |
|  Sequential testing p-value | This is the p-value with sequential testing, when the experiment uses it |
|  Chance to beat control | This is the probability that the test group beats control. Only Bayesian results have it |
|  Expected loss | This is the expected loss of shipping the test group. Only Bayesian results have it |
|  Relative topline impact | This is the test group's effect on the metric's total across all units, in percent |
|  Projected relative topline impact | This is the effect on the metric's total that Statsig projects if the test group ships to everyone, in percent |

### Experiment exposures

This explore reads how many units each group of one Statsig experiment has had exposed, one row for each group and day. Dates are in UTC

| Field | Description |
| - | - |
|  Experiment ID | This is the experiment's ID. A query needs a filter on it with one experiment |
|  Group ID | This is the ID of the experiment group |
|  Group | This is the name of the experiment group |
|  Date | This is the day, in UTC |
|  Exposures | This is the number of units exposed to the group, from the start of the experiment up to the day |

### Feature gates

This explore lists the feature gates of one Statsig project, one row for each gate, with Statsig's own stale classification and recent check rate. Dates are in UTC

| Field | Description |
| - | - |
|  Gate ID | This is the gate's ID, its name in lowercase with underscores |
|  Name | This is the gate's display name |
|  Description | This is the description of the gate |
|  Status | This is the status of the gate: `In Progress`, `Launched` or `Disabled` |
|  Type | This is the type Statsig gives the gate: `TEMPORARY`, `PERMANENT`, `STALE` or `TEMPLATE` |
|  Type reason | This says why Statsig calls the gate stale, such as `STALE_PROBABLY_LAUNCHED` or `STALE_NO_RULES`, or `NONE` |
|  ID type | This is the unit the gate checks, such as `userID` or `stableID` |
|  Owner | This is the name of the owner of the gate |
|  Creator | This is the name of the person who created it |
|  Team | This is the team that owns the gate |
|  Tags | These are the gate's tags, joined with commas |
|  Enabled | This says whether the gate is turned on |
|  Created | This is the day the gate was created, in UTC |
|  Last modified | This is the day the gate was last changed, in UTC |
|  URL | This is the link to the gate in Statsig |
|  Checks per hour | This is how many times an hour the gate was checked recently, as Statsig samples it |
|  Exposures past day | This is how many exposures Statsig counted for the gate in the past day |
|  Exposures past 7 days | This is how many exposures Statsig counted for the gate in the past 7 days |

### Metric values

This explore reads the daily values Statsig computes for the project's metrics: one value for each metric, unit type and day, across all units. Dates are in UTC

| Field | Description |
| - | - |
|  Date | This is the day of the value, in UTC |
|  Metric | This is the name of the metric, such as `dau` |
|  Metric type | This is the type of the metric, such as `user`, `event_count` or `sum` |
|  Display name | This is the name Statsig shows for the metric |
|  Unit type | This is the unit the value counts, such as `userID`, `stableID` or `overall` |
|  Value | This is the metric's value for the day |
|  Numerator | This is the numerator of a ratio metric's value, when it has one |
|  Denominator | This is the denominator of a ratio metric's value, when it has one |
|  Input rows | This is how many rows Statsig computed the value from |

### Experiment results by dimension

This explore reads one metric's Pulse result for one test group of one Statsig experiment, broken down by the dimensions Statsig computes, such as country or platform. Statsig computes every number

| Field | Description |
| - | - |
|  Experiment ID | This is the experiment's ID. A query needs a filter on it with one experiment |
|  Results date | This is the day of the results. Without a filter, the results cover the whole experiment |
|  Test group | This is the name of the test group |
|  Test group ID | This is the ID of the test group. A query needs a filter on it with one test group |
|  Control group | This is the name of the experiment's control group |
|  Control group ID | This is the ID of the control group |
|  Dimension | This is the dimension Statsig breaks the result down by, such as country. `!statsig_topline` marks the result across all units |
|  Dimension value | This is the value of the dimension, such as US for country |
|  Metric ID | This is Statsig's ID of the metric, its name and type like `dau::user`. A query needs a filter on it with one metric |
|  Metric | This is the name of the metric |
|  Desired direction | This is the direction the metric should move: `increase` or `decrease` |
|  Result error | This says why Statsig has no numbers for the metric, such as `no_data`. It is empty when there are numbers |
|  Test mean | This is the metric's mean among test units |
|  Control mean | This is the metric's mean among control units |
|  Test units | This is the number of test units |
|  Control units | This is the number of control units |
|  Absolute change | This is the test mean minus the control mean, in the metric's unit |
|  Percent change | This is the change of test units against control units, in percent |
|  Confidence interval lower | This is the lower bound of the absolute change's confidence interval |
|  Confidence interval upper | This is the upper bound of the absolute change's confidence interval |
|  Percent confidence interval lower | This is the lower bound of the percent change's confidence interval, in percent |
|  Percent confidence interval upper | This is the upper bound of the percent change's confidence interval, in percent |
|  P-value | This is the p-value of the change |

### Gate rule results

This explore reads Statsig's Pulse results for the rules of one feature gate: for each rule and monitoring metric, units that pass the rule compared with units that fail it. Statsig computes every number

| Field | Description |
| - | - |
|  Gate ID | This is the gate's ID. A query needs a filter on it with one gate |
|  Rule ID | This is the ID of the rule |
|  Rule | This is the name of the rule |
|  Pass percentage | This is the percent of matching units the rule lets through |
|  Results date | This is the day of the results |
|  Metric ID | This is Statsig's ID of the metric, its name and type |
|  Metric | This is the name of the metric |
|  Desired direction | This is the direction the metric should move: `increase` or `decrease` |
|  Result error | This says why Statsig has no numbers for the metric, such as `no_data`. It is empty when there are numbers |
|  Pass mean | This is the metric's mean among pass units |
|  Fail mean | This is the metric's mean among fail units |
|  Pass units | This is the number of pass units |
|  Fail units | This is the number of fail units |
|  Absolute change | This is the pass mean minus the fail mean, in the metric's unit |
|  Percent change | This is the change of pass units against fail units, in percent |
|  Confidence interval lower | This is the lower bound of the absolute change's confidence interval |
|  Confidence interval upper | This is the upper bound of the absolute change's confidence interval |
|  Percent confidence interval lower | This is the lower bound of the percent change's confidence interval, in percent |
|  Percent confidence interval upper | This is the upper bound of the percent change's confidence interval, in percent |
|  P-value | This is the p-value of the change |

### Recent events

This explore reads the custom events Statsig received over a window of at most 7 days, one row for each event, newest first. Timestamps are in UTC

| Field | Description |
| - | - |
|  Timestamp | This is when Statsig received the event, in UTC |
|  Event name | This is the name the event was logged with |
|  User ID | This is the user ID the event was logged for |
|  Value | This is the value the event was logged with, as text |
|  SDK | This is the SDK that sent the event |
|  SDK version | This is the version of the SDK that sent the event |

## Limits

| Limit | Value |
| - | - |
| Most rows per query | 2,999 |
| Required filters | Experiment results and Experiment exposures need one Experiment ID. Experiment results by dimension needs one Experiment ID, Metric ID and Test group ID. Gate rule results needs one Gate ID |
| Results date | One day, or the whole experiment without a filter |
| Metric values | Up to 31 days per query. Last 7 days by default |
| Recent events | A window of up to 7 days. Today and yesterday by default |
| Not available | Per-user or per-account usage, grouping metric values, funnels and event history beyond the recent window. Export Statsig data to your warehouse for these |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.