Experiment

Check variation

Check which variation of an experiment is assigned to a user.

val experimentId = "experiment-1"
tesfyEngine.getVariationId(experimentId, null) // "1"

A userId and attributes could be optionally supplied.

val experimentId = "experiment-2"
val userId = "676380e0-7793-44d6-9189-eb5868e17a86"
val attributes = mapOf("countryCode" to "us")
tesfyEngine.getVariationId(experimentId, userId, attributes) // "1"

Set forced variation

Set a fixed variation for a given experiment. Helpful functionality if you want to do tests.

val experimentId = "experiment-1"
val variationId = "3"
tesfyEngine.setForcedVariation(experimentId: experimentId, variationId: variationId)
tesfyEngine.getVariationId(experimentId: experimentId) // "3"