How to force a user to be in the treatment group f...
# announcements
b
How to force a user to be in the treatment group for an experiment? Write an entry in the exposure table of the database?
f
Hi Sam - writing in the exposure table will not work, as that is no queried on assignment. You can use targeting rules to ensure a user or group of users gets a particular treatment, but forcing a user to be included in particular variation isn’t good practice, and not super easy to do
b
Targeting rules is exactly what I needed
TYVM!
wait so when I call
getFeatureValue
it doesn't look at the exposure table?
f
no
we use deterministic hashing, the same values will always give the same variation
b
got it very cool
f
ya, means no state needs to be shared through GrowthBook, so you can run tests on client side and server side, and get the same variation. And you can run it without a 3rd party call
b
Does targeting rule override experiment rule?
is it possible to have both running at once?
f
yes - rules work in order, so first matching rule is served
you can also add targeting to a specific experiment
b
So if I want user 1903 and 10% of users in the experiment I should do 2 rules? (the rules above are all disabled).
f
1. rules are processed in order, so there is a chance that user 1903 will be included in the 10% first experiment. 2. If you want to force 1903 into the control case for your experiment, you’ll have to use the same tracking key for both override rules. (are you sure you want to do this? If you just want to make sure user 1903 sees the control, consider using a force rule)
b
I want to make sure 1903 sees treatment
Trying this
Desired behavior: 1. 2.75% users assigned to experiment1 treatment 2. user 1022954 assigned to experiment1 treatment 3. everyone else not assigned to experiment1 treatmen
Copy code
neither of these result in any traffic going to the treatment.

Targeting rule inside experiment (breaks rule 1)
"experiment1":{"defaultValue":false,"rules":[{"condition":{"user_id":1022954},"variations":[false,true],"coverage":0.11,"weights":[0.5,0.5],"key":"icai_v_6_0_sam","hashAttribute":"user_id","namespace":["exclusive_ab",0.25,0.5]}]},
Copy code
Separate forced rule (screenshot above. (breaks rule 1))
"experiment1":{"defaultValue":false,"rules":[{"variations":[false,true],"coverage":0.11,"weights":[0.5,0.5],"key":"icai_v_6_0_sam","hashAttribute":"user_id","namespace":["exclusive_ab",0.25,0.5]},{"condition":{"user_id":1022954},"force":true}]} ``````
This sends traffic to experiment but breaks rule 2
Copy code
"experiment1":{"defaultValue":false,"rules":[{"variations":[false,true],"coverage":0.11,"weights":[0.5,0.5],"key":"icai_v_6_0_sam","hashAttribute":"user_id","namespace":["exclusive_ab",0.25,0.5]}]}