PrestaShop Forums: Google Analytics Conversion - Only picks up around half my orders - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Google Analytics Conversion - Only picks up around half my orders


Google Analytics Conversion - Only picks up around half my orders

#1 Guest_mayday_*

  • --
  • Guests

Posted 18 March 2010 - 10:47 AM

Hi all

I'm having a problem with Google Analytics. It is only recording around half of my conversions (orders).


Anyone else having similar problems?

- Cory
www.outdoorstore.ch

#2 Guest__*

  • --
  • Guests

Posted 19 March 2010 - 11:16 AM

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.

#3 Guest__*

  • --
  • Guests

Posted 19 March 2010 - 12:23 PM

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?

-Cory
www.outdoorstore.ch

#4 Guest__*

  • --
  • Guests

Posted 19 March 2010 - 12:39 PM

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.

#5 Guest__*

  • --
  • Guests

Posted 19 March 2010 - 12:48 PM

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!

#6 Guest__*

  • --
  • Guests

Posted 19 March 2010 - 12:53 PM

Ok, i'll let you know !

Raph.

#7 Guest__*

  • --
  • Guests

Posted 23 March 2010 - 08:19 AM

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 > Positions
Add the ganalytics module to the new stats hook
(delete the old placed in footer hook)

3. Edit footer.php
in the $smarty->assign
add this line after 'HOOK_FOOTER'...
'HOOK_STATS' => Module::hookExec('stats'),


4. Edit footer.tpl of your theme
Add {$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 !





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users