Welcome to WebmasterWorld Guest from 54.205.96.97

Forum Moderators: DixonJones & mademetop

Page load dependencies by where G Analytics is loaded

Tested to move it from the end of html to the javascript

   
5:18 pm on Jan 28, 2009 (gmt 0)

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



I posted here already my experiences with load time optimization.

Google AdSense reports more page impressions
Google Anayltics reports less page impressions

Now I made a further test at 2 small domains.

Google Analytics code by document.write at the end of the javascript loaded by the page.

The result, againg drastic less visits, compared to other statistic sources.

12:05 pm on Jan 29, 2009 (gmt 0)

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



Just have now 1,5 days from 2 small domains with the new method for Google Analytics

old method: insert tracking code as end of html
new method: insert tracking code by document.write in a javascript

Analytics showed much less visitors, but the main proplem seems to be MSIE

The Google Analytics browser stats are

MSIE - 1..27 January: 57,45%
MSIE - 28..29 January: 15,62%

Firefox 1..27 January: 33,81%
Firefox 28..29 January: 81,25%

Any idea, what problem at MSIE could be with

document.write ( "Here goes my Google Analytics Code" );

4:07 pm on Jan 29, 2009 (gmt 0)

5+ Year Member



I'm not sure I understand your question. But if the code is at the bottom of the page, there can be incidents where a user comes to your site and then instantly clicks on a link and leaves the page before the analytics code can load. This is solved by putting the code at the top but then the pages load a little slower.
5:00 pm on Jan 29, 2009 (gmt 0)

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



To make it clear

before

<script=my.js></script>
.....here goes my Google Analytics code
</body>

after

<script=my.js></script>
</body>

javascript file

....here are about 25 kb functions from me....
....at the end...
document.write ( .....here goes my Google Analytics code )

3:12 am on Jan 30, 2009 (gmt 0)

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



that's because in method one the GA code is processed in line with your document.
(well is does have to fetch an external script first, google-analytics.com/ga.js)

in method two, you must get to the bottom of your document, fetch the my.js, then at the end of fetching and processing that 25kb and doing the document write, you must still do all the work above.

i'm guessing your ff browser is better configured handle simultaneous connections than ie.
also ff might be faster at processing javascript than ie.

6:10 am on Jan 30, 2009 (gmt 0)

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



i'm guessing your ff browser is better configured handle simultaneous connections than ie.
also ff might be faster at processing javascript than ie.

I would more quess, some mad MSIE security setings on 80% to 90% of MSIE browsers.

A difference loading an javascript from an other domain - google - in the html file or the javascript file.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month