Add Google Analytics or StatCounter code to Magento Sites
A lot of people want to add Google Analytics and StatCounter javascripts to their Magento sites, but don’t know where to add the code.
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
Additional info for earlier versions of Magento added.
Thanks for the tip, but when I pasted the Statcounter code into CMS>Static Blocks>Footer Links, it only tracked the homepage of my site.
To track ALL pages, I found the following solution on the Magento website which works a treat:
http://go.magento.com/support/kb/entry/name/how-to-embed-html-scripts-in-the-body-tag/
Hope this helps!
Annie – thank you! This is really good to know.
Thanks for sharing this post, It helped me a lot while adding analytic to my ecommerce store, and this post also found useful.