I'm trying to set up a GA content experiment and see an error in the Chrome console that reads "Variations should be chosen before hit is sent to GA". The error only appears the first time I load the page before cookies are set. If I clear cookies and reload, it appears
It doesn't seem to cause any problems but am curious as to what it means. I posted in Google Forums but no one has explained it. Anyone here have any ideas?
Here's my code
<script src="http://www.google-analytics.com/cx/api.js?experiment=lYhtgjICSTGh0PEyfMA30w"></script>
<script>
var chosenVariation = cxApi.chooseVariation();
var pageVariations = [
function() {
$("#pdp_promo2").append($("#tagineBanner"));
$('#tagineBanner').show();
},
function() {
$("#banner").attr('src', '/wcsstore/CVWEB/images/home/bnr_tagineB.jpg')
$("#pdp_promo2").append($("#tagineBanner"));
$('tagineBanner').show();
}
];
$(document).ready(
pageVariations[chosenVariation]
);
</script>