0
votes

Hi I just add google analytics to a site. I used the code that google give 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-57032837-1', 'auto');
  ga('send', 'pageview');

</script>

and didn't work (tracking not installed). So I search and found this one:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-57032837-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' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Now GA says: Tracking Installed (but isn't showing me any result - tracking or stadistics-). I must to wait? I'm doing something wrong? I'm a web designer not a developer, so some help will be great! thx.

2

2 Answers

0
votes

You are mixing up a classic GA implementation (your latter code) with a Universal Analytics one (your former code). Which version are you using? Have you already migrated your web properties to UA? I suspect that since you mentioned that you just added the code, then you're using UA. In this case, make sure you have the UA tracking code on your site (the former code). It normally takes at least 24 hours for the code to start processing data into your standard reports, at which time the status will say "Tracking not installed". If you check your real-time reports for your own visits and you can see hits there, then you should be fine, and only need to wait.

0
votes
  1. Try going on your website's homepage (or any page where the code is supposed to show up), pull up the source code for the webpage (right click > "show source code" or something similar) and try searching for the GA code. Is it present?

  2. If it is indeed present, go to any page where the code is implemented, and try going to your GA and check the "real time" section. The interface should show at least "1 visitor" being connected.