Welcome to WebmasterWorld Guest from

Forum Moderators: DixonJones & mademetop

Message Too Old, No Replies

Google Analytics Installation

Which method do you use?

11:50 am on Jul 9, 2008 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 27, 2001
posts: 12166
votes: 51

Google Analytics Installation Guide

I typically use the Basic Installation method but am looking at the options right now to see if we can ward off a small percentage of 404s that are coming from failed GA script execution. We seem to have narrowed that particular issue down to a laundry list of potential causes. One of them has to do with the browser not executing the JS in proper sequence which causes the second JS to fire before the first which in turns causes the 404 and the GA appendage to the URI.

I've seen people place their GA code after the <body> element. Before the closing </body> element as the Basic Installation recommends. I've also seen external references in the head. And, we are now working on serving the scripts dynamically, that would be the ultimate goal I think.

But, before we do, I want to find out from others how they are handling the GA scripts and what challenges you've run into with any 404s being generated by the scripts in the Basic Installation model.

8:32 am on July 10, 2008 (gmt 0)

Preferred Member

5+ Year Member

joined:Nov 20, 2007
votes: 0

Personally, putting the GA script near the end of the content is best, usually just before the </body>

My reason is that you want to track people who have successfully opened the page. Also, putting it early in the content would slow down the loading of the page.

2:02 pm on July 10, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 11, 2006
votes: 0

If you're using event tagging (for things like opening PDFs or tracking off-site links), then you need the tracking code before those event handlers, which is why many of us put the tracking code just after the opening <body> tag.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members