I'm running a google analytics experiment, and I'm only getting sessions for one variant.

  • The original page redirects to the variant page when testing.
  • "Distribute sessions evenly" option is set to on.
  • Both pages validate in the google experiment admin
  • Experiment code is immediately after the opening <head> tag, on original page only. Variant page only has the normal GA tracking code.
  • GA script tag and ga.create is right before closing </head> tag on both pages
  • ga.send('pageview') is right before closing </body> tag, as well as some js code to send events to GA when user clicks links.

186 sessions on the experiment, and 186 sessions on original page only. No sessions on the variant page.

Also, when I'm redirected to the variant page, I get the plain url without any UTM codes in the querystring.

I'll post the HTML if needed.


Here's the original page HTML. Variation page is the same, except without the Content Experiment code, just the analytics tag. I do get events record in analytics from the variation page, just not in the experiment:


<!-- Google Analytics Content Experiment code -->
<script>function utmx_section(){}function utmx(){}(function(){var
function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
'<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':
'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date().
'" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})();
<!-- End of Google Analytics Content Experiment code -->

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', '###', 'auto');

<script type="text/javascript">
  ga('send', 'pageview');

  $('a.red_button').click(function(e) {
    ga('send', 'event', 'Click', 'red_button', 'conversion');


  • You can use Tag Assistant Chrome Extension to check if the variant has the proper GA tracking code. Also make sure it has the same property tacking code and that both pages have pageviews/events in the same view.
    – Osvaldo
    Commented May 5, 2017 at 18:23
  • I did each of those. All good, but still nothing in analytics experiment reports. I'll update my answer and show code.
    – stampede76
    Commented May 6, 2017 at 0:20

1 Answer 1


I'd use Google Optimize (not to be confused with Optimizely, which is a similar service created by former googlers).

With it, you can run experiments on page variations with ease, it's an included service on the Google Platform. You'll be able to track sessions on the variations without having to jump into the source code.

Though it may seem like you prefer your current route, I figured I'd include this option just so you're not losing time on A/B tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.