In order to use Google Analytics, you need to register an account first. Then create a website profile for it. Finally, you need to insert the tracking code into your website. There are 2 tracking codes currently – Legacy Tracking Code (urchin.js) and New Tracking Code (ga.js). Be sure to use the New Tracking Code (ga.js) because it can gain access to a wide range of exciting new features as they become available.
So where should I put it? You should put it into every webpage you want to track immediately before the </body> tag. Most of the websites use a footer template to display the bottom website layout. Just copy and paste the tracking code there.
Example, put the code right before </body>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
var pageTracker = _gat._getTracker(“UA-xxxxxxx-x”);