Welcome to WebmasterWorld Guest from 54.166.152.121

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)

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Google Analytics Installation Guide
[google.com...]

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 Jul 10, 2008 (gmt 0)

5+ Year Member



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 Jul 10, 2008 (gmt 0)

5+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month