Hi, I would like to know how to call an A/B experi...
# ask-questions
b
Hi, I would like to know how to call an A/B experiment , such that feature flag changes its value for different user ids. My feature flag is boolean True by default. as per the documentation, I have implemented :
Copy code
1. final TrackingCallback trackingCallback = new TrackingCallback() {
				@Override
				public <ValueType> void onTrack(final Experiment<ValueType> experiment, final ExperimentResult<ValueType> experimentResult) {
					System.out.println("Experiment Id: " + experiment.getKey());
					System.out.println("Variation Id: " + experimentResult.getVariationId());
				}};


2. setting the GB Context (attributesStr has ids for eg. ("id":"123") : 	
final GBContext context = GBContext.builder().featuresJson(featuresJson).trackingCallback(trackingCallback).attributesJson(attributesStr).build();
I am running this experiment for a single user id, i have hard-coded it right now. value of feature flag is not changing as per the "Test feature rule" that we have in Growthbook. Please guide me here. Stuck here
f
what does the rule look like in growthbook?
b
@fresh-football-47124
f
can you show the rules on the feature flag too?
b
here it is @fresh-football-47124
f
why are you expecting it to change the value?
b
since i have A/B experimentation, so the value should change right? like suppose it should randomly give id 1- true, and 2-false.. like here
f
looks like you have an experiment rule, and since you're fixing the user id, I would expect it to always return the same value for that flag experiment
you're getting the same value for different IDs you set?
I am running this experiment for a single user id, i have hard-coded it right now.
b
so my problem statement is here, if i hard code id as 1, then as per the "Test Feature Rule", it should be True. but it is giving me False.
f
your SDK might not support hashing version 2
b
how shall i upgrade it? any documentation?
f
no, we're working on supporting v2 for all SDKs - but it will still work fine, just the simulation feature won't reflect the values (you can mouse over that alert triangle)
you can change the ID and see if its randomly assigning a mix of true and falses
b
yes, it does. for eg for id 586, as per "Test feature rule" it is False but I am getting True
f
you can edit your experiment and set it to v1 hashing
b
not able to find that option to change hashing
f
sorry, edit the feature rule
b
I have checked my java sdk, it is as per the guidelines to support v2 hashing
by editing the feature rule do you mea changing the default value of feature flag?
f
no
edit the exp rule
b
is it for premium users only? because i am not able to see it
@fresh-football-47124
c
Wrote to you in direct messages.
f
(its not)