Description
Create an api that enrolls users i.e. get enrollment for this user.
- Query the MPIC experiments api to get buckets (feature variants)
- Add the bucketing algorithm to assign users by id to a bucket (user will always be in this bucket for the duration of the experiment)
- There is pre-existing code in WME that provides a similar algorithm based on page id. We can refactor this code to use user id instead.
- Evenly bucket users based on number of features + control
- In the Growth team’s use case there is 1 variant so users will be bucketed 50/50 - 0.5 control and 0.5 treatment bucket
- If there are 2 feature variants, there will be 3 buckets (including control) split into thirds (33% or 0.33)
- If there are 3 feature variants, there will be 4 buckets (including control) set at 0.25 each
Use the BeforePageDisplay hook to read the api response to fetch the bucket names and ratios, and write to a config variable that will contain the user’s bucket assignments for all experiments the user is enrolled in.
Acceptance Criteria
- New experiment enrollment API is created
- Bucketing of users is evenly divided between number of buckets + control
- Bucketing is based on user id of logged-in users
Required
- Unit/Integration tests?
- Documentation?
- Passed QA?