Assignments
Assignment SQLs tell Eppo where to find a log of every time a subject (e.g., user) was enrolled into an experiment, the name of that experiment, and the variant that was assigned. Assignment SQLs can point to either logs from Eppo's SDK or from existing internal or third party randomization tools. You can also create multiple assignment sources if you use a combination of assignment methods.
Assignment SQLs can also include properties to use to filter or split results.
SELECT
ts_assigned,
experiment_name,
variant_name,
user_id,
-- optional properties that may be later used to split results
browser,
device_type
FROM mydb.myschema.assignments
In this example, user_id
is assigned to experiment_name
in the variant_name
treatment group.
Creating an Assignment SQL
- Navigate to Definitions and click Create Definition SQL
- Click Assignment SQL
- Select the subject (randomized unit) of the Assignment SQL. To learn more about specifying multiple randomization units Eppo, see the entities page.
Name your Assignment SQL
Write SQL in the SQL editor to pull assignments from your data warehouse and click Run
At a minimum, this query should return a unique identifier for the subject (e.g., user_id
), a unique identifier for the experiment, the variant the subject received, and a timestamp. You can also add optional subject properties such as browser or country.
If you do not yet have assignment logs in your warehouse, see the Event Logging page.
Then click Run, and the rows from that assignment table should appear in the bottom left.
- Annotate the columns that you've selected from the data warehouse
In case there's any ambiguity as to which properties the columns correspond to, we annotate them here.
- Adding optional properties
Your feature flag tooling may have logged additional data about the user, like what country they're from or which browser they're using. You can annotate these additional properties here, and they will show up under the Entity Property SQL tab.
Holdout columns are also defined here. More information is available on the dedicated page.
- Click Save & Close
Handling duplicate assignments
Eppo has built in filtering to handle scenarios where there are multiple assignment events for a subject with different data. Here are a few common scenariios that you may encounter and how Eppo handles them:
1. Subject has multiple assignment events where they received multiple variations.
Example: A subject received both the Control
and Treatment
within an experiment.
Eppo will automatically filter these subjects out of that experiment's results.
2. Subject has a property that is recorded in the assignment table change during the experiment.
Example: A subject in their first assignment has property called country
that initially is recorded as Canada
and in a subsequent assignment the country
property is recorded as France
.
Eppo will use the first recorded property in the experiment. When looking at an Explore chart using the example above, the user would show up under the Canada
property value.
Updating Assignments
You can update assignments by clicking the Edit
button to access the Assignment SQL. At this point you can edit the SQL as you like, but the mapping fields will be locked down until the SQL is validated with a run.
Pressing the Run
button will enable the mapping fields and the Save & Close
button to save any changes made in either the SQL or mapping.
Any running experiments with assignment based on the updated Assignment SQL will automatically fully refresh on the next experiment update.
Deleting Assignments
You can delete or mark as deprecated an Assignment SQL. First, access the Assignment SQL by clicking the Edit
button.
If the assignment is being used, you can click Mark as deprecated
; you will the a list of active experiment using that Assignment. New expriments will not be able to use that fact.
To delete an unused Assignments SQL, click Delete Assignment SQL
from the overflow menu.
For either action, a confirmation modal will appear detailing the metrics and experiments impacted.