jspicher
jspicher

Reputation: 113

google analytics experiments "No Google Analytics tracking code found."?

hopefully someone can help me out.

So l have a google analytics experiment running. However when l set it up and click the "validate code" button l get this error: No Google Analytics tracking code found.

For both the original, and the variation page.

The thing is, l DO have the google analytics code on the pages.

One thing to note is that my google analytics tracking code looks a little different than most.

It looks like this:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxxxx-1', 'mysite.com');
  ga('send', 'pageview');
  ga('require', 'ecommerce', 'ecommerce.js');

</script>

Also it's important to note that the site is tracking visits properly in google analytics. Can anyone help me out?

Upvotes: 1

Views: 1424

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

When I last checked (yesterday) Universal Analytics did not support (yet) content experiments (although it was announced support would be coming soon). I guess you opened a new GA account - new accounts are now set to Universal Analytics as default, you have to manually switch to the previous asynchronous version. However you cannot change this after you started tracking. IF this is a new account it might be feasible to lose the data already collected and start with a new account that set to the previous version.

Bottom line, you either have to wait with your test until support for content experiment is added or you start again with a new account (or you implement another account parallel to the current one and do your test from there, which to me sounds rather untidy).

Upvotes: 0

Related Questions