Jump to content

how to add google analytics?


Recommended Posts

I enabled the google analytics module and all it ask for is the Username for the google anaylytics account. But when I check in my google analytics site profile the tracking code is not installed.

I have read the below post and I tried to put my analytics code at /themes/mythemes/footer.tpl but didn't work.

http://www.prestashop.com/forums/viewthread/49516/installation_de_prestashop/resolugoogle_analytics

Can someone help me ?

Regards
Archproject

Link to comment
Share on other sites

  • 2 weeks later...

Hello there! Can you please help me, I would like to know how to get google analytics on my prestashop page. First of all I do not see a module for it therefore I cannot enable it. Where can I download a module for it or how or where can I see it. Please be specific. Thanks!!!!

Link to comment
Share on other sites

Well I tried to add the javascript in the footer.tpl in the mythemes folder and when I refresh google analytics page it says that the code was not installed. Usually the page will say that it's fetching data from site and would get the data within about 24 to 48 hrs or so but not at the moment it's not doing so. maybe I will try to add it in the header.tpl .. later ...

Link to comment
Share on other sites

The real benefit of having javascript code in the footer, is that the browser will render the html/css code - so the user will see a page - then after it has output the html - it will render javascript.

Keep in mind that the browser gets the code from your server - but also from google's server -> which means a couple of milliseconds in extra delay.

But try the footer and keep us updates!

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...

Hi in version 1.3 i had the google analytics working just fine but since i upgraded i can't seem to get the satats to work in the 1.4 version any advice? Also i know it takes about 24 hours after you make any changes before you can see results from googles analytics. So, testing it out could take days! I tried adding it with transplant to another hook to see if it would track and the same thing happened NOTHING! lol. I wish i could help i am going through the same thing.

I am going to make another GA module I hate this one I'll post when I'am done with it!

Link to comment
Share on other sites

  • 3 years later...

it's simple.

prestashop is based on smarty engine.

smaty syntax uses brackets.

 

so, if you paste script with brackets, compiler thinks that it's a smarty syntax, but in fact - it isn't. After that, page crashes.

 

if you use {literal} {/literal} tags you will inform compiler that code between these tags arent a part of smarty code, so compiler will not compile it :)

  • Like 2
Link to comment
Share on other sites

Thank you vekia. Now I understand why I get a blank page when I insert google analytics script at version 1.5.6. On the other hand I have a few ps 1.5.2 websites that work just fine with script code without {literal} {/literal} tags. Do I have to change the code at those sites as well? What would you suggest?  

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

I would like to know whether the Presta google analytic module does something more than adding the code on the fly to the pages (footer.tpl) like a proxy.

 

Is there someting enhanced or magic in google analytics module or does it merely add the tracking code into the e.g. footer.tpl?

 

thank you.

  • Like 1
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...