Assignment data sources
This topic explains how to analyze LaunchDarkly experiments using exposure data from an external data warehouse.
Assignment data records which contexts were exposed to which experiment variation. By default, LaunchDarkly generates this data from the flag or AgentControl config evaluations that your SDKs send. An assignment data source replaces that default with a query against your own warehouse. This lets you measure experiments where assignment happens outside LaunchDarkly. For example, you can analyze an experiment that an email platform, a marketing tool, or an internal data pipeline assigned.
Experiments that use an assignment data source do not use a flag or config. Instead, you select an assignment data source and the experiment you want to analyze from within that source.
A single assignment data source can contain assignments for many experiments, and you can reuse it across multiple experiments in the same project and environment.
Prerequisites
To create an assignment data source, you need:
- An existing warehouse native Experimentation integration. To learn more, read Setting up external warehouses.
- A table or view in your warehouse containing the assignment data you want to analyze with the columns described in Assignment data requirements.
- A role with the
createAssignmentDataSourceaction. To learn more, read Assignment data source actions.
Experiments that use an assignment data source have the following constraints:
- They must use warehouse native metrics.
- They do not use a flag config, which means they can’t use targeting rules.
- They can use only one assignment data source each.
- They cannot use holdouts or layers.
- You must create the assignment data source before you build the experiment.
Warehouse access
When you set up your warehouse native Experimentation integration, you grant LaunchDarkly read access to the database and schema that contain your metric events.
If LaunchDarkly cannot read your assignment data, an error appears when you preview your query, along with the SQL statements that grant the access LaunchDarkly needs. Run those statements in your warehouse, then preview your query again.
Assignment data requirements
Each row your query returns represents one context’s exposure to one experiment variation. Your query must return a column for each of the following fields:
Choose a timestamp column that uses the timestamp or datetime format and encodes timezone information. LaunchDarkly uses the exposure timestamp to determine which metric events to attribute to each context. An ambiguous timezone can cause LaunchDarkly to attribute events incorrectly.
Use and manage assignment data sources
To learn how to create and use assignment data sources, read Creating and managing assignment data sources.