Wednesday, September 19, 2012

Adding Google Analytics to your page

  1. Step 1:Create your new analytics account if you haven't already.

  2. Step 2:Go to the account and click the admin button
  3. Step 3:Choose the Tracking Code tab
  4. Step 4:Copy and paste the tracking code you'll find near the bottom
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-34933034-1']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  5. Step 5:Open your account in and go to the blog account

  6. Step 6:Click Edit HTML and proceed. Then paste in the script code from above underneath right about the tag.
  7. Step 7:In your developer tools you can check that this works by looking in your Network secton to see if the __utm.gif is set with the correct account number. To do so click the gif and look for the utmac value (UA-XXXXXX-1) and it should match that value found in the JS you just pasted in.

No comments:

Post a Comment