split-analytics icon indicating copy to clipboard operation
split-analytics copied to clipboard

When there are more than 5 experiments the index used for the script is messed up.

Open andrehjr opened this issue 6 years ago • 0 comments

The index on _setCustomVar cannot be greater than 5, see: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables

            <script type="text/javascript">
          var _gaq = _gaq || [];
          _gaq.push(["_setAccount", "UA-11223344-1"]);
          
          _gaq.push(["_setCustomVar", 4, "ab_test_four", "c", 1]);
_gaq.push(["_setCustomVar", 5, "ab_test_five", "a", 1]);
_gaq.push(["_setCustomVar", 6, "ab_test_six", "b", 1]);
_gaq.push(["_setCustomVar", 7, "button_color_on_signup", "green", 1]);
_gaq.push(["_setCustomVar", 8, "button_color_on_login", "green", 1]);
          _gaq.push(["_trackPageview"]);
          (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl.google-analytics.com/ga.js' : 'http://www.google-analytics.com/ga.js');
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
          })();

andrehjr avatar Apr 03 '19 16:04 andrehjr