Skip to main content

Assignment Sources

Assignment Sources are how you schematize your assignment data for Statsig, and they serve as the input data for determining who is in an experiment, and which treatment they got.

Creating an Assignment Source

To create an assignment source, go to the experiments tab in Statsig and go to the Assignment Sources pane.

An Assignment Source is defined as a SQL query and a mapping of the output columns to specific fields Statsig requires (user identifiers, a timestamp, an experiment identifier, and a group identifier).

Assignment Source

Scanning Assignment Sources

Statsig scans assignment sources on-demand and/or on a schedule to find experiment data. These jobs are very quick and identify unique groups, the ID types present in the experiment, and the estimated of users per group.

Once the scan is complete, you can view and create experiments from the Assignment source. The assignment's experience will also populate the Experiment creation flow after the scan completes.

Screenshot 2024-06-11 at 3 12 00 PM

Manage Assignment Sources

In the Assignment Source tab, you can see your Assignment sources and the experiments they're being used in.

Assignment Source Tab

Example Data

For experiment assignment sources, Statsig requires information on who was exposed, when, and to what experiment:

Column TypeDescriptionFormat/Rules
timestampRequired an identifier of when the experiment exposure occurredCastable to Timestamp/Date
unit identifierRequired at least one entity to which this metric belongsGenerally a user ID or similar
experiment identifierRequired the experiment the exposure was forUsually an experiment name
group identifierRequired the experimental variant the user was assigned toUsually a group name
additional identifiersOptional Entity identifiers for reuse across identifier types
context columnsOptional Fields which can be used to group by and filter results in exploratory queries

For example, you could pull from exposure event logging directly:

timestampuser_idcompany_idexperiment_namegroup_namecountry
2023-10-10 00:01:01my_user_17503c_22235455ranking_v1_vs_v2v1US
2023-10-10 00:02:15my_user_18821c_22235455ranking_v1_vs_v2v2CA
2023-10-10 00:02:22my_user_18821c_22235455search UI revampcontrolCA