https://www.growthbook.io/ logo
b

billions-memory-82613

05/10/2023, 11:17 PM
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

fresh-football-47124

05/10/2023, 11:38 PM
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

billions-memory-82613

05/10/2023, 11:41 PM
Targeting rules is exactly what I needed
TYVM!
wait so when I call
getFeatureValue
it doesn't look at the exposure table?
f

fresh-football-47124

05/10/2023, 11:49 PM
no
we use deterministic hashing, the same values will always give the same variation
b

billions-memory-82613

05/10/2023, 11:50 PM
got it very cool
f

fresh-football-47124

05/10/2023, 11:50 PM
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

billions-memory-82613

05/11/2023, 9:04 PM
Does targeting rule override experiment rule?
is it possible to have both running at once?
f

fresh-football-47124

05/12/2023, 12:22 AM
yes - rules work in order, so first matching rule is served
you can also add targeting to a specific experiment
b

billions-memory-82613

05/15/2023, 2:52 PM
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

fresh-football-47124

05/15/2023, 7:23 PM
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

billions-memory-82613

05/17/2023, 2:34 PM
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]}]}
4 Views