google-experiments

cxApi.chooseVariation() always returning 0

不问归期 提交于 2020-01-02 07:57:08
问题 My site is a single page webapp. I'm loading the experiment code with my experiment id: <script src="//www.google-analytics.com/cx/api.js?experiment={@ js_settings.analytics.experimentid @}"></script> After all is loaded, at the moment I display the page, I select the right template by calling a function which does the following: ga('set', 'expId', experiment_id); var variation = cxApi.getChosenVariation(experiment_id) || cxApi.chooseVariation(); cxApi.setChosenVariation(variation, experiment

Server-side Google Analytics Experiments

允我心安 提交于 2019-12-24 10:39:32
问题 I'm wondering why I have to include the JavaScript cxApi when I'm running the experiments server-side. Furthermore, can I send the chosen experiment and variations by PHP? Or maybe by injecting a JavaScript snippet without external resources (like the cxApi). I'm using Universal Analytics on the front-end and on the back-end. 回答1: Take a look at this library: php-gacx (Server-Side Google Analytics Content Experiments PHP Client) https://github.com/thomasbachem/php-gacx They parse cxApi

Page hiding snippet for Google Content Experiments

拟墨画扇 提交于 2019-12-24 09:59:25
问题 I am trying to get rid of flickering effect. I am using GTM + Google experiments API code as a GTM tag. I want to adapt Optimize's page hiding snippet in order to use it with Content Experiments. https://support.google.com/360suite/optimize/answer/7100284 <HTML> <HEAD> <!-- Page hiding snippet (recommended) --> <style>.async-hide { opacity: 0 !important} </style> <script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; h.end=i=function(){s.className=s.className.replace

How to use Google Content Experiment with Google Tag Manager

試著忘記壹切 提交于 2019-12-13 04:31:53
问题 I couldn't find any answers on how to use/implement Google Content Experiments with GTM. I currently have set-up a GTM container with GA code and in the original page for the experiment i have the Google Experiment Code at the beginning of the html tag. The problem I'm having is that not all users are counted in Google Analytics Experiments Report. Is it still impossible to use Google Content Experiments in GTM? (How to run Google Experiment within Google Tag Manager - seems a bit old

How do you implement horizontal candlesticks using the Google Charts API?

浪子不回头ぞ 提交于 2019-12-10 15:48:46
问题 I'd like to use the Google Charts API, but they don't seem to support this (at least publicly). This is what I'd like to replicate (for an internal report): screenshot Edit: This is the closest thing that I've found: https://developers.google.com/chart/interactive/docs/reference#barformatter 回答1: There is no easy way to do exactly the same thing, but you can cheat a bit and get something like this (you can customize as needed for further fine tuning): Basically, I make a stacked bar chart

Run multiple simultaneous tests with Google Content Experiments API

二次信任 提交于 2019-12-06 04:37:43
问题 I'm trying to use Google Content Experiments API to run several A/B tests simultaneously in the same page (similar to a multivariate test). I've tried just putting all the recommended code for each test one after another, like this: <script src="//www.google-analytics.com/cx/api.js?experiment=8RsNt4b7T0aE8RC2s9R3IA">/script> <script> var chosenVariation = cxApi.chooseVariation(); var pageVariations = [ function() {}, function() { $(".block1").hide(); }, ]; $(document).ready( pageVariations

cxApi.chooseVariation() always returning 0

﹥>﹥吖頭↗ 提交于 2019-12-05 21:40:50
My site is a single page webapp. I'm loading the experiment code with my experiment id: <script src="//www.google-analytics.com/cx/api.js?experiment={@ js_settings.analytics.experimentid @}"></script> After all is loaded, at the moment I display the page, I select the right template by calling a function which does the following: ga('set', 'expId', experiment_id); var variation = cxApi.getChosenVariation(experiment_id) || cxApi.chooseVariation(); cxApi.setChosenVariation(variation, experiment_id); ga('set', 'expVar', variation); ga('set', 'dimension1', variation); ga('send', 'pageview'); Now,

Run multiple simultaneous tests with Google Content Experiments API

天涯浪子 提交于 2019-12-04 10:17:49
I'm trying to use Google Content Experiments API to run several A/B tests simultaneously in the same page (similar to a multivariate test). I've tried just putting all the recommended code for each test one after another, like this: <script src="//www.google-analytics.com/cx/api.js?experiment=8RsNt4b7T0aE8RC2s9R3IA">/script> <script> var chosenVariation = cxApi.chooseVariation(); var pageVariations = [ function() {}, function() { $(".block1").hide(); }, ]; $(document).ready( pageVariations[chosenVariation] ); </script> <script src="//www.google-analytics.com/cx/api.js?experiment=T3m

google analytics content experiment without redirect getting no visitors

北城以北 提交于 2019-12-01 14:42:08
I have implemented a GA experiment with no redirect <script type="text/javascript">_udn = 'example.com'; _uhash='off';</script> <script type="text/javascript" src="//www.google-analytics.com/cx/api.js?experiment=ExperimentID"></script> <script type="text/javascript">var chosenVariation = cxApi.chooseVariation();</script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'AccountID']); _gaq.push(['_setDomainName', 'example.com']); _gaq.push(['_setAllowHash', false]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type =

How to run Google Experiment within Google Tag Manager

半世苍凉 提交于 2019-11-28 11:02:39
I have been trying to get this to work for sometime and there seems to be very little information on how this works. First, I would like to say that I tried the below method to get it working, so please read this before posting a solution. What I tried: I added the google analytics experiment code in a custom HTML block and had it fire only of the original page as stated by google. This doesn't work and seems to create a loop for users. A white page appears when users get to the experiment pages. Does anyone know how to get this to work? Much appreciated The Javascript versions of Google