adriesilva Posted August 20, 2013 Share Posted August 20, 2013 Hello, I am attempting to add Google Analytics to my Prestashop. Google says, " You'll get a tracking code to paste onto your pages so Google knows when your site is visited." In what pages should I add this code to? Do I want to add it to just one page? and which one? Thank you. Any and all help is appreciated. Link to comment Share on other sites More sharing options...
swsindonesia Posted August 21, 2013 Share Posted August 21, 2013 Hi, your google analytics code should like something like this: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXX-X']); _gaq.push(['_setCustomVar', 1, 'Authenticated', 'Yes', 1]); _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> The only *best* place to paste this code is in you themes/THEME_NAME/header.tpl just before the closing </head> tag 1 Link to comment Share on other sites More sharing options...
stottycabanas Posted August 21, 2013 Share Posted August 21, 2013 Let Prestashop do it for you. The steps to get this working are: Go to the Google Analytics website, sign up for an account. A Tracking ID and a snippet of Tracking Code will be generated for you (you have these). (Install and) configure the Prestashop Google Analytics module by copying the Tracking ID into the Your username box & click Update ID Ignore the snippet of Tracking Code from Google - the Prestashop module will use the Tracking ID to generate the required code snippet within your shop. Check the Status on your Google Analytics account to see when it is set to 'Tracking Installed'. At that point (should be within 24 hrs), data will start being collected and then you can use the reporting function. 2 Link to comment Share on other sites More sharing options...
ritabarr Posted August 21, 2013 Share Posted August 21, 2013 (edited) Hello, I added the code to the header.tpl as instructed however it made the page not render at all. I've decide to use the prestashop module to avoid problems during rendering. Stottycabanas, Can you tell me which google analytics module you are referring to? It appears there are several in the addon shop. Thanks! Edited August 21, 2013 by ritabarr (see edit history) Link to comment Share on other sites More sharing options...
stottycabanas Posted August 21, 2013 Share Posted August 21, 2013 Ritabarr, I didn't get it from the addons shop - I definitely didn't pay any money for it. I'm pretty sure it was already there in the list of modules in version 1.5.4.1. Before installing it, it was towards the bottom of the list of modules and looked like this: After installation, it was in alphabetical order under 'G' and looked like this: 2 Link to comment Share on other sites More sharing options...
ritabarr Posted August 22, 2013 Share Posted August 22, 2013 Perfect! Thanks stottycabanas Link to comment Share on other sites More sharing options...
stottycabanas Posted August 22, 2013 Share Posted August 22, 2013 You're welcome! Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2013 Share Posted August 22, 2013 thanks for the solution stottycabanas im going to mark this topic as [sOLVED] regards Link to comment Share on other sites More sharing options...
Recommended Posts