Adding Google Analytics Code through the magento backend
It is very easy to add the Google Analytics Code In Magento there is no need to edit the code file for this just follow these steps below:
Step 1 : First you need register your website on the google analytics and it will provide you the Analytics code for registering on the Google Analytics click here http://www.google.com/analytics/sign_up.html
Step 2 : Now Copy your code and navigate to the System –> Configuration –> Google API Under the Sales Tab in left sidebar and then click on the Google Analytics Tab in Right side it will look like as below:
Step 3 : Insert your code of the Google Analytics in it and Press to the Save Config button on the Top Right, for confirmation on the front end Refresh all your browsewer cache and and view the Page Source of the Home page then you will get the Google Analytics code in it.