You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Loritsch, Berin C." <Be...@gd-ais.com> on 2010/01/08 15:06:37 UTC

Google analytics on home page slowing down access

Just an FYI, the call to google-analytics on the Wicket home page is
causing the site to crawl as I have to wait for the connection to time
out before I see anything (at least 30s).

That is because the call is in the header, and it should be placed at
the bottom of the <body> section to avoid this problem.  Most browsers
will be able to display the page as it is loading resources in the order
they are declared.  For things like google analytics and populating ads,
it's best to incorporate those javascript goodies after the page is
rendered.

Example:

Move the following snippet:

<html>
<head>
<!-- ... -->
  <SCRIPT type="text/javascript">
_uacct = "UA-2350632-1";
urchinTracker();
</SCRIPT>
<!-- ... -->
</head>
</html>

To the following location:

<html>
<body>
<!-- ... -->
  <SCRIPT type="text/javascript">
_uacct = "UA-2350632-1";
urchinTracker();
</SCRIPT>
</body>
</html>


Re: Google analytics on home page slowing down access

Posted by Ryan Gravener <ry...@gmail.com>.
Yea, that code should be at the bottom of the page.

Ryan Gravener
http://bit.ly/no_word_docs


On Fri, Jan 8, 2010 at 9:06 AM, Loritsch, Berin C. <
Berin.Loritsch@gd-ais.com> wrote:

> Just an FYI, the call to google-analytics on the Wicket home page is
> causing the site to crawl as I have to wait for the connection to time
> out before I see anything (at least 30s).
>
> That is because the call is in the header, and it should be placed at
> the bottom of the <body> section to avoid this problem.  Most browsers
> will be able to display the page as it is loading resources in the order
> they are declared.  For things like google analytics and populating ads,
> it's best to incorporate those javascript goodies after the page is
> rendered.
>
> Example:
>
> Move the following snippet:
>
> <html>
> <head>
> <!-- ... -->
>  <SCRIPT type="text/javascript">
> _uacct = "UA-2350632-1";
> urchinTracker();
> </SCRIPT>
> <!-- ... -->
> </head>
> </html>
>
> To the following location:
>
> <html>
> <body>
> <!-- ... -->
>  <SCRIPT type="text/javascript">
> _uacct = "UA-2350632-1";
> urchinTracker();
> </SCRIPT>
> </body>
> </html>
>
>