Vote to Improve PrestaShop

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content

 
Photo

[SOLVED] Google Analytics code should be in the <head> section!


  • Please log in to reply
10 replies to this topic
Housy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 208 posts

Posted 17 January 2011 - 12:18 PM

Hello,

I'm using Prestashop 1.3.5 and i noticed that if i add google analytics code through built-in module, it doesn't work properly, becuase module adds code into body section (into footer, if i'm being more precise), instead of the head section.

How to fix it? If i add this manually it doesn't work.

Cheers

Housy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 208 posts

Posted 17 January 2011 - 12:28 PM

If i add Google analytics code just before </head> tag, i get server error (500).

Why is that?

Even if i transplant Google Analytics module into Header, it doesn't work, nothing happens, the code is missing when i look for the source code in the browser.

I just hope, this guy in THIS THREAD will fix the problem, cause i'm not that smart =/

Thanks

abilas

    PrestaShop Apprentice

  • Members
  • PipPip
  • 26 posts

Posted 17 January 2011 - 04:46 PM

Google Analytics doesn't go in the header, it must go before the closing </BODY> tag. The reason is that google analytics watches every page that is created and provides stats on every page that is being accessed.

I suggest you take a look at setting up goals within your shop so that you can track each customer that comes to your site.

Cheers
T :)

Housy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 208 posts

Posted 18 January 2011 - 08:38 PM

Google Analytics doesn't go in the header, it must go before the closing </BODY> tag. The reason is that google analytics watches every page that is created and provides stats on every page that is being accessed.

I suggest you take a look at setting up goals within your shop so that you can track each customer that comes to your site.

Cheers
T :)



Well, I didn't use goals, i just pasted the analytics code right before </body> and now i get good results =)

I'll also read more about goals =)

Thanks ;)

abilas

    PrestaShop Apprentice

  • Members
  • PipPip
  • 26 posts

Posted 18 January 2011 - 09:26 PM

[SOLVED] Glad this information helped, google analytics is a powerful tool to help filter down what is being looked at.

Good luck with your shop.

abilas

    PrestaShop Apprentice

  • Members
  • PipPip
  • 26 posts

Posted 18 January 2011 - 09:26 PM

Will you also change the subject line to read [SOLVED] etc... so users are informed that this has been resolved.

Thanks

Housy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 208 posts

Posted 18 January 2011 - 09:37 PM

I did =)

Thanks again ;)

easyweb

    PrestaShop Newbie

  • Members
  • Pip
  • 10 posts

Posted 12 February 2011 - 03:25 PM

Sorry for the noob question...but how do I add the google analytics code to my website?
In which file is the body tag located?

mayid

    PrestaShop Apprentice

  • Members
  • PipPip
  • 39 posts

Posted 23 February 2011 - 03:07 PM

I think Google changed it's mind, and now it wants to add the code in the header. By other side, the code changed. So, module should be updated.

Now i'm facing the same problem than Housy: i cannot position the module in the Head of Pages. It just wont show up.

#10 inveostore.com
inveostore.com

    PrestaShop Apprentice

  • Banned
  • PipPip
  • 176 posts

Posted 23 February 2011 - 06:23 PM

Moving GA code to the head section can make your site slow when Google servers are busy. This is the reason why it is recommended (and PS does do) to place GA code to footer.

aliaspt

    PrestaShop Apprentice

  • Members
  • PipPip
  • 191 posts

Posted 27 August 2011 - 04:09 AM

Where can I find detailed instruction on how to insert the new Google Analytics code? What file does it go to and do I need to uninstall the old Google Analytics Module 1.2? I am using PS 1.3. The old code is causing error messages during checkout.
Thank you.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users