steveosoule
3/22/2016 - 6:22 PM

Custom Google Analytics Content Experiment

Custom Google Analytics Content Experiment

// Note: this will throw an error if it doesn't run before _gaq's _trackPageView
$.getScript('//www.google-analytics.com/cx/api.js?experiment=EXPERIMENT_ID', function(){
	var variation_classes = ['mobile-search--show', 'mobile-search--hide'],
		variant_class = variation_classes[cxApi.chooseVariation()];

	$('body').addClass(variant_class);
});