Data Sources
What is a Data Source?
Section titled “What is a Data Source?”A Data Source is a read-only connection from GrowthBook to your warehouse or database. GrowthBook uses this connection to run analysis queries on demand — it never writes data back. Supported engines include BigQuery, Snowflake, Postgres, MySQL, ClickHouse, Redshift, Databricks, Athena, PrestoDB, and more.
Connecting a data source
Section titled “Connecting a data source”Step 1 — Open Data Sources
Section titled “Step 1 — Open Data Sources”- Log in to GrowthBook.
- In the left sidebar, navigate to Analysis then click Data Sources.
- Click Add Data Source.
Step 2 — Choose a connection type
Section titled “Step 2 — Choose a connection type”- Select your warehouse type (e.g. BigQuery, Snowflake, or Postgres).
- Enter the connection details your warehouse requires:
- BigQuery: paste a service account JSON key and choose the default project.
- Snowflake: enter account, warehouse, database, schema, username, and password.
- Postgres / MySQL: enter host, port, database name, username, and password.
- Click Test Connection to verify GrowthBook can reach your warehouse.
- Click Save.
Step 3 — Write the experiment assignment query
Section titled “Step 3 — Write the experiment assignment query”The assignment query is the most important query in GrowthBook. It answers the question: “Which user saw which experiment variation, and when?”
A typical assignment query selects four columns:
| Column | What it contains |
|---|---|
experiment_id | The GrowthBook experiment key (e.g. checkout-redesign) |
variation_id | The variation index the user was assigned to (0 = control, 1 = variation A, …) |
user_id | A stable user identifier (user UUID, anonymous ID, etc.) |
timestamp | When the assignment happened (UTC) |
Example for a BigQuery events table:
SELECT experiment_id, variation_id, user_id, timestampFROM `myproject.analytics.experiment_viewed`WHERE timestamp >= '{{ startDate }}' AND timestamp <= '{{ endDate }}'GrowthBook substitutes {{ startDate }} and {{ endDate }} automatically when it runs the analysis.
Step 4 — (Optional) Add identifier joins
Section titled “Step 4 — (Optional) Add identifier joins”If your warehouse uses different ID types (anonymous cookie ID vs logged-in user ID), add Identifier Joins so GrowthBook can stitch them together across the assignment and metric tables.
No warehouse? No problem
Section titled “No warehouse? No problem”If you are just getting started and don’t have a data warehouse, GrowthBook can work without one for basic feature flags and targeting. You can add a data source later when you are ready to run statistical experiments. GrowthBook also supports uploading CSV data for lightweight experimentation.