0

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.

Barney Szabolcs
  • 11,846
  • 12
  • 66
  • 91
  • possible duplicate of [Optimizely: Get the variation of the current visitor](http://stackoverflow.com/questions/17326157/optimizely-get-the-variation-of-the-current-visitor) – Barney Szabolcs Jul 04 '14 at 10:13
  • duplicate of http://stackoverflow.com/questions/17326157/optimizely-get-the-variation-of-the-current-visitor?rq=1 and the question is basically answered there. – Barney Szabolcs Jul 04 '14 at 10:13

1 Answers1

2

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