Jump to content

Google Analytics


Recommended Posts

Hi, there. I've been running my shop for about a month and a half, and just realized that my Google Analytics aren't tracking anything on my Prestashop site, even though I configured the Google Analytics module, by inputting my user i.d. Is there anything else I need to do? If I'm going to install the analytics code manually, how would I do that, since I never actually wrote an HTML page for my virtual shop? i.e., what file would I access, and in which directories, to paste my analytics code into? I'd be happy with it just being in the order.php, products.php, and main shop homepage file.

For the former two, would i just paste the code directly into these php files? And where would I paste it for the main shop home page?

Thanks!

Link to comment
Share on other sites

Not sure how you would inject it from a theme template point of view since I went right to the module at hand, however I believe it is something wrong with the javascript the module is outputting. In the module file I replaced the output with the most current javascript from google's website and was able to get it working and tracking correctly.

From your installation root directory the file is located at modules/ganalytics/ganalytics.php

The function responsible is function hookTop($params)

I changed the code to the following and was able to get it working correctly

function hookTop($params)
   {
       global $step;
       $output = '
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
[removed](unescape(""));


var pageTracker = _gat._getTracker("' . Configuration::get('GANALYTICS_ID') . '");
pageTracker._initData();
pageTracker._trackPageview();
';
       return $output;
   }

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Hola, puedes encontrar el modulo dentro de prestashop

Dentro de : Stats -
Google Analytics v1.2
Integrar el script de Google Analytics en su tienda

luego necesitas añadir el id de tu cuenta en analitycs por ejemplo: UA-12779022-1

Otra forma seria añadiendolo al pie de página ( footer inc o similar )

Un saludo, espero que te fucione.

Link to comment
Share on other sites

  • 3 years later...

Okay im having the same issue! Ive configured the module and its not taking to google analytic s??  And I as well dont have : hookTop($params) in the code but i do have: hookHeader($params)

 

So can someone please help me..Should i add tracking code to each page? 

Link to comment
Share on other sites

Also lil update I did check the code and the module did insert the google analytics strings:

 

http://addons.prestashop.com/en/analytics-stats-prestashop-modules/6447-advanced-google-analytics.html

 

so that did work but course not working ..its been over 48 hours since i configured module and just checked and still no go. I wonder if the below mod would help? Or would just manually adding the tracking code be the best way at this point.. Prob with that is cause PS files I cant tell where to out the code cause in .tpl files there is no body ior header tags that instructions said to use to determine where to put code. Im not a programmer so im sure location to put code is easy fix but not sure if that si best option. Cause module has already put some code on all the pages.

 

 

 

http://addons.prestashop.com/en/analytics-stats-prestashop-modules/6447-advanced-google-analytics.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...