Where did you place your Google Analytics script?
Hopefully not in the <head>…
Google’s Analytic script is pretty intensive and if placed in the head then your pages could be taking longer to load than need be.
Your script, like the one below, should be placed directly before the close of the </body> tag!
- <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
- </script>
- <script type="text/javascript">
- _uacct = "UA-XXXXXXX-1";
- urchinTracker();
- </script>
Judging by the fact that some big dogs like: Copyblogger, ShoeMoney and CSSBeauty all have it wrong, you might want to check yourself.
Just trying to give you a <head>s up 🙂
August 7th, 2007 at 7:52 am
Thanks for the heads up!
CSS Beauty has been using G analytics since it came out. Back then google used to tell people to add the script to head. I guess no longer true 🙂
August 7th, 2007 at 7:58 am
Fixed!
August 7th, 2007 at 8:13 am
Hey Alex, thanks for stopping by. We at Search-This love CSS Beauty; it’s a great resource for sure. And thanks for giving us a mention last week, much appreciated.
August 7th, 2007 at 8:14 am
Ahh, my older version of the google-analyticator plugin for wordpress sticks it in the head. Looks like version 1.54 allows you to specify where to put the code. Thanks for this reminder!
August 7th, 2007 at 8:24 am
Wow, after moving it to the footer I saw a noticeable increase in speed. Thanks again for the tip!
August 7th, 2007 at 8:44 am
@Jeremy: yep, Google Analytics is a real hog, check it out in Firebug and you can see just what a pig it is. This one move can really increase load times!
August 7th, 2007 at 12:57 pm
Yep, it was just above , but I must admit I had to check it out to be sure. 🙂
August 8th, 2007 at 4:37 am
The reason a lot of sites have it at the top is because, when GA was first released, that’s where the instructions said to put it.
August 13th, 2007 at 10:54 am
So GA slows down sites? Just another reason to run NoScript…
December 25th, 2008 at 3:57 pm
Actually, any javascript should be moved from the head space, I remember 10 years ago when I put all my javascript code in this space 😉
December 30th, 2009 at 10:44 am
GA told people to put it there when it was first released. I actually placed it there to start with on my blog, and it slowed it down a lot.
I took it out and deleted the Cache and it works fine now. Fast as can be, although it seems to leave behind a small ‘lag’ even after I took it out.
Regards,
Jakk – your fellow Technoholic 😀
March 28th, 2010 at 9:59 pm
As a Google SEOer,I have to say the google put the web load time as a important factor in google rank. so the dynamic content must be little, if you need the JS, please put it at the bottom after the dom
August 22nd, 2010 at 1:00 am
Thank you very much,after moving it before the close of the tag, I saw a noticeable increase in speed.