Analytics
2.8K members online now
2.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

chooseVariation method not working for an experiment

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have done everything in the tutorial for an experiment but with a same page.

 

So what I do is :

 

<script src="https://www.google-analytics.com/cx/api.js?experiment=rq8xSjMtTnqg4e9i13S3Iw"></script>

 

and then 

var chosenVariation = cxApi.chooseVariation();
console.log(chosenVariation);

 

the variation is always 1 while I have an original page and a variant setup in the settings.