Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Does the GA code have to be at the bottom of the page?

8:45 am on May 28, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 20, 2004
votes: 0

They tell you to place it just before </body>.

I assume that this is done so that when users don't load the entire page, they don't get counted?

What happens if I place it higher up the page? I have an element in dynamic PHP pages that sets up the page type higher up - can I place my code there?

9:51 am on May 28, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 25, 2004
votes: 0

They suggest just above </body> so that all of your page will display as quickly as possible even if the G code is slow to load for some reason.

They used to recommend putting their code much earlier, but people complained. It isn't any sort of conspiracy!



10:59 pm on May 28, 2007 (gmt 0)

New User

10+ Year Member

joined:May 24, 2007
votes: 0

Putting the code much earlier means

website would be very slow in loading in browser