Barney Szabolcs
Barney Szabolcs

Reputation: 12544

How can I get the active experiment/variant name in optimizely?

I try to integrate Optimizely with AngularJS and I want to show different templates based on what variation is running. I would add a constant function to the Angular app, that would check if a variant/variants are active.

sth like

function isVariant(variantNames) {
   return true; // if any of the variants are active.
}

I could not find in the Optimizely documentation on how to get this data.

Upvotes: 0

Views: 602

Answers (1)

user3805299
user3805299

Reputation: 36

You can check which experiments are active with

optimizely.activeExperiments

To get the variation in which you are bucketed you can use

optimizely.variationNamesMap

Chris

Upvotes: 2

Related Questions