Skip to main content
In order to use GrowthBook for experimentation, you need to connect to a data source. There are two main ways to configure GrowthBook: via the UI, or via a config.yml file. The default way to define these is by filling out forms in the GrowthBook UI, which persists them to MongoDB. The other option is to create a config.yml file, which allows for version control and easier management of your configuration. In the Docker container, this file must be placed at /usr/local/src/app/config/config.yml. Below is an example file:

Data Source Connection Params

The contents of the params field for a data source depends on the type. As seen in the example above, you can use environment variable interpolation for secrets (e.g. ${POSTGRES_PW}).

Redshift, ClickHouse, Postgres, and Mysql (or MariaDB)

Redshift and Postgres also support optional params to force an SSL connection:

Snowflake

BigQuery

You must first create a Service Account in Google with the following roles:
  • Data Viewer
  • Metadata Viewer
  • Job User
If you want GrowthBook to auto-discover credentials from environment variables or GCP metadata, use the following:
If you prefer to pass in credentials directly, you can use this format instead:

Presto and TrinoDB

Databricks

AWS Athena

If you want GrowthBook to auto-discover credentials from environment variables or instance metadata, use the following format:
If you prefer to specify access key and secret directly instead, use the following format:

Data Source Settings

The settings tell GrowthBook how to query your data. There are a couple queries you need to define plus an optional Python script to run queries from inside a Jupyter notebook:

Organization Settings

Some organization settings can also be controlled from config.yml. Below are all of the currently supported settings:
The updateSchedule setting has 3 types of values:
  • Never update automatically
  • Update if data is X hours stale
  • Update on a fixed Cron schedule

Unit Dimensions

Unit Dimensions let you join additional tables in order to drill down into your experiment results. Dimensions only have 4 properties: name, datasource, userIdType, and SQL. The SQL query must return two columns: the identifier type and value. Example:
By default, when using config.yml, it’s not possible to create dimensions via the GrowthBook UI. Everything must be done directly in the config.yml file. There is an optional environment variable you can specify to change this behavior:
This will let you create new dimensions via the UI. Dimensions defined in config.yml will be marked as “Official” and not editable, while ones defined via the UI will be editable.

Metrics (Deprecated)

Legacy metrics can be defined in the config.yml file as well, although this behavior is deprecated. If you want to version control metrics, the recommended approach is to integrate your version control system with our API instead. See a guide here for doing this with GitHub. Below is an example of all the possible settings with comments for legacy metrics defined in config.yml:
In addition to all of those settings, you also need to tell GrowthBook how to query the metric with SQL. Depending on the other settings, the columns you need to select may differ slightly:
  • timestamp - always required
  • value - required unless type is set to “binomial”
Plus, you need to select a column for each identifier type the metric supports. A full example:
And a simple binomial metric that only supports logged-in users:
By default, if a user has more than 1 non-binomial metric row during an experiment, we sum the values together. You can override this behavior with the aggregation setting:

Allow Creating Metrics in the UI

By default, when using config.yml, it’s not possible to create legacy metrics via the GrowthBook UI. Everything must be done directly in the config.yml file. There is an optional environment variable you can specify to change this behavior:
This will let you create new metrics via the UI. Metrics defined in config.yml will be marked as “Official” and not editable, while ones defined via the UI will be editable.