Google Analytics Setup

Permalink
I'm trying to get Google Analytics set up on my site, but I'm just getting the "Status: Tracking Not Installed" thing from Google.

I've gone to the dashboard and pasted in the tracking code that google gave me:
<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-XXXXXXXX-X', '....com');
  ga('send', 'pageview');
</script>

And put it in the header. (Yes I edited out the UA number and website name). When I look at the source of my site, it is showing up in the header.

I'm using one of the default themes (Greek Yogurt).

 
Adreco replied on at Permalink Reply
Adreco
I've experienced this on a site that I had requesting tracking on ashttp://mysite.com but installed it onhttp://www.mysite.com
I'd forgotton to add the redirect to my .htaccess file :(
williarj replied on at Permalink Reply
So I've tried switching fromhttp://www.mysite.com to mysite.com as the URL in google analytics, neither work. I'm not awesome enough to know how to edit the .htaccess file correctly, but I can ping my site at both with and without www, does that mean the redirect is setup already?
Adreco replied on at Permalink Reply
Adreco
If both addresses end up looking the same once your site is displayed (either both www. or both non), your redirect is working as it should and that was not the problem.
I know this may be a silly question, but.... did you wait a few minutes after installing the code, then refreshed the Google analytics page? It often doesn't show as working unless the page is refreshed.
williarj replied on at Permalink Reply
it eventually started working, it just took about 24 hours before the "Not installed" error went away and data started showing up.

I thought there was a problem, because every time I refreshed the google analytics page it would say "last checked at TIME" where TIME is when I refreshed. But its better now.

Thanks for your help though!