Thursday, September 26, 2013

How to add Google Analytics to your website or Blogger


You can easily add Google Analytics to your web site

Step 1 : Visit Google Analytics site: www.google.com/analytics/

Step 2 : Now sign in with your Gmail Account.

Step 3 : Click on Sign Up button. Add the necessary details and click on Get Tracking ID

Step 4 : Copy the Tracking ID

Step5: Add the tracking code to your website. Copy the tracking code and paste it into the HTML of your web page just before the closing head tag.


UA-XXXXX-Y will be replaced by a Tracking ID for your website in a below piece of code.

--------------------------------------------------------------------------------------------------
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-Y']);
  _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>

------------------------------------------------------------------------------------------------------------------------------

If it is WordPress site,

Open header.php

Find </head> tag and Paste Google Analytics tracking code before < / head >

No comments:

Post a Comment