Add Google Analytics or StatCounter code to Magento Sites
I find the best place is to go to CMS > Static Blocks > Footer Links and add them there.
In some cases however (older versions of Magento perhaps), you may be better off editing the footer.phtml file in the app > design > frontend > default > currenttheme > template > page > html folder.
Google Analytics also needs to be enabled in Magento. To do this, first find the Web Property ID of the Google Analytics profile. This is right on the first page of your site’s profile, next to your domain name and starts UA… Copy it, then go to the Magento admin interface, then System> Configuration> Google API> Google Analytics. Change Enable to Yes and paste in the Web Property ID. Save the changes and hopefully, that’s it.other page