lemon-stone-42630
04/12/2022, 1:08 PMgrowthbook.forceVariation
does not work. Is there some other way to force variation?
When initializing the feature information is:
{
"value": true,
"on": true,
"off": false,
"source": "experiment",
"ruleId": "",
"experiment": {
"variations": [
true,
false
],
"key": "webtest-feature",
"weights": [
0.5,
0.5
],
"hashAttribute": "session_id"
},
"experimentResult": {
"inExperiment": true,
"variationId": 0,
"value": true,
"hashAttribute": "session_id",
"hashValue": "45274132-7196-4e23-8f8c-ceece9fc9d16"
}
}
After growthbook.forceVariation('webtest-feature', 1)
it seems to be:
{
"value": true,
"on": true,
"off": false,
"source": "defaultValue",
"ruleId": ""
}
future-teacher-7046
forceVariation
method doesn't work for experiments run through feature flags. As soon as you force a variation, you are no longer "included" in the experiment and the rule will be skipped.
There is the setForcedFeatures
method instead which lets you directly override the value of a feature.
growthbook.setForcedFeatures(new Map([
['webtest-feature', false]
]))
forceVariation
does work for features, which should be more intuitivelemon-stone-42630
04/12/2022, 2:06 PM