mayday Posted March 18, 2010 Share Posted March 18, 2010 Hi allI'm having a problem with Google Analytics. It is only recording around half of my conversions (orders).Anyone else having similar problems?- Corywww.outdoorstore.ch Link to comment Share on other sites More sharing options...
RaphLeMousse Posted March 19, 2010 Share Posted March 19, 2010 Hello,yes i have the same problem... do you use E-Commerce option or only goals ? Or Adwords conversions (it's ot the same)... I identified the problem, but still did not find any solution... When you use the analytics module from prestashop, the analytics tracking code is placed in the main section of the page... that does not allow the tag to execute properly. You can track visits, bounce rate and all of those data's, but not all e-commerce stuffs (as the analytics tag is correctly running until the tag is loaded.So the solution would be to extract the analytics tracking from the of the page to place it just before the </body> tag... but i still did not find how to do it . If you have an idea... Raph. Link to comment Share on other sites More sharing options...
mayday Posted March 19, 2010 Author Share Posted March 19, 2010 Yeah, I think you're right. I can see how that might be the problem.I looked into seeing if I could move it ... but it's beyond my limited php skill set.Can any of you pro's out there help us out?-Corywww.outdoorstore.ch Link to comment Share on other sites More sharing options...
RaphLeMousse Posted March 19, 2010 Share Posted March 19, 2010 I just got an answer from a french speaking user on the other forum: Salut,Pour intégrer le script de google il vous suffit de le mettre dans le footer.tpl.pensez à l’encadrer avec les balise {literal}If you don't speak french, here is the translation:To integrate the google script, just add it in the footer.tpl. Add it between {literal} tags.I hope it will work for you, i'll try it right now on my website !Raph. Link to comment Share on other sites More sharing options...
mayday Posted March 19, 2010 Author Share Posted March 19, 2010 Do let me know if you get it too work. Because I opened up footer.tpl, and it still seems to me like it's going to be more complicated than the short response you got in french ...THX! Link to comment Share on other sites More sharing options...
RaphLeMousse Posted March 19, 2010 Share Posted March 19, 2010 Ok, i'll let you know !Raph. Link to comment Share on other sites More sharing options...
MakeOpen Posted March 23, 2010 Share Posted March 23, 2010 Hey,I have also the same problem.Raph, here is the method for call analytics module at really bottom of the page :1. Create a new entry in the HOOK db table : INSERT INTO `PREFIX_hook` ( `id_hook` , `name` , `title` , `description` , `position` ) VALUES ( NULL , "stats", "Stats Hook", "", "1" ); 2. Prestashop > Modules > PositionsAdd the ganalytics module to the new stats hook(delete the old placed in footer hook)3. Edit footer.phpin the $smarty->assignadd this line after 'HOOK_FOOTER'... 'HOOK_STATS' => Module::hookExec('stats'), 4. Edit footer.tpl of your themeAdd {$HOOK_STATS} just before </body>5. Edit ganalytics.php (in modules)Add public function hookStats($params) { return $this->hookFooter($params); } after function hookFooter($params) { global $step, $protocol_content; $output = ' [removed] [removed](unescape("[removed][removed]")); [removed] [removed] try { var pageTracker = _gat._getTracker("'.Configuration::get('GANALYTICS_ID').'"); pageTracker._trackPageview(); '.(strpos($_SERVER['REQUEST_URI'], __PS_BASE_URI__.'order.php') === 0 ? 'pageTracker._trackPageview("/order/step'.intval($step).'.html");' : '').' } catch(err) {} [removed]'; return $output; } 6. Clear tools/smarty/compile folder (not index.php)Hope this help ! Link to comment Share on other sites More sharing options...
Recommended Posts