Skip to main content

Introduction

You can export your data from Statsig to your data warehouse with a data connection. This lets you send exposures and events directly to your warehouse for further analysis. We currently support connections to Snowflake, Redshift, S3, BigQuery, and Databricks.
Data Warehouse Exports are an Enterprise-only feature. If you are on the Developer or Pro tiers and wish to upgrade to Enterprise, feel free to reach out to our team here or via support.

How to Begin

  1. Go to Statsig Console
  2. Navigate to the Help and Tools Section on the side navigation bar
  3. Go to “Exports List”
Statsig Help and Tools menu showing Exports List option
On the Exports page, you will find an Export History tab and a Schedule Export tab. The Export History tab shows you a list of all previous experimentation exports triggered from the Experiment Results page. To understand how to export one-off experimentation results, check out the documentation here. Under the Scheduled Export tab, you will be prompted to set up a data warehouse connection. You will be required to set up connections with the necessary credentials and grant Statsig Read, Write, and Delete permissions. The warehouse-specific tabs below show the fields Statsig asks for and example SQL you can use to create each export table yourself.
Scheduled export setup form for Snowflake connection with credential fields

Table Schema

Statsig can export both Exposures and Events to your destination. The exported columns are logically the same across SQL warehouses, but the physical types vary by warehouse. S3 is a file destination rather than a SQL table destination.
Setup summaryConfigure:
  • BigQuery Project ID
  • BigQuery Dataset ID
  • one destination table name per export type
Permissions:
  • grant the Statsig service account BigQuery User at the project level
  • grant the same service account BigQuery Data Editor on the target dataset
Statsig uses this access to create the table if needed and validate the connection by inserting and deleting a test row.If you prefer to create the export tables yourself, you can use SQL like this:
BigQuery Exposures
CREATE TABLE IF NOT EXISTS `PROJECT_ID.DATASET_ID.EXPOSURES_TABLE` (
  company_id STRING,
  unit_id STRING,
  unit_type STRING,
  exposure_type STRING,
  name STRING,
  rule STRING,
  experiment_group STRING,
  first_exposure_utc TIMESTAMP,
  first_exposure_pst_date DATE,
  as_of_pst_date DATE,
  percent FLOAT64,
  rollout BIGINT,
  user_dimensions STRING,
  inserted_at TIMESTAMP,
  rule_name STRING,
  group_id STRING,
  non_analytics BOOLEAN
);
BigQuery Events
CREATE TABLE IF NOT EXISTS `PROJECT_ID.DATASET_ID.EVENTS_TABLE` (
  user_id STRING,
  stable_id STRING,
  custom_ids JSON,
  timestamp TIMESTAMP,
  event_name STRING,
  event_value STRING,
  user_object JSON,
  statsig_metadata JSON,
  company_metadata JSON
);
ExposuresPlease note that we do not export exposures from rules that are 0%/100%.
Field nameTypeMode
company_idSTRINGNULLABLE
unit_idSTRINGNULLABLE
unit_typeSTRINGNULLABLE
exposure_typeSTRINGNULLABLE
nameSTRINGNULLABLE
ruleSTRINGNULLABLE
experiment_groupSTRINGNULLABLE
first_exposure_utcTIMESTAMPNULLABLE
first_exposure_pst_dateDATENULLABLE
as_of_pst_dateDATENULLABLE
percentFLOAT64NULLABLE
rolloutBIGINTNULLABLE
user_dimensionsSTRINGNULLABLE
inserted_atTIMESTAMPNULLABLE
rule_nameSTRINGNULLABLE
group_idSTRINGNULLABLE
non_analyticsBOOLEANNULLABLE
Events
Field nameTypeMode
user_idSTRINGNULLABLE
stable_idSTRINGNULLABLE
custom_idsJSONNULLABLE
timestampTIMESTAMPNULLABLE
event_nameSTRINGNULLABLE
event_valueSTRINGNULLABLE
user_objectJSONNULLABLE
statsig_metadataJSONNULLABLE
company_metadataJSONNULLABLE

Troubleshooting Exports

If you set up an Export flow in Statsig, Statsig can notify you if your data connection is failing. To enable notifications, go to Settings → My Account → Email Notifications → Edit and click Alerts to subscribe to these notifications. If your Exports are failing, make sure your warehouse is connected with up-to-date credentials and the necessary Read, Write, and Delete permissions.