Also on twitter ( twitter.com/nutrun )

Does Google Analytics make your pages slow?

Quite frankly, I think it does.

I’ve been concerned with the time the nutrun pages took to load recently. Some basic profiling on the server didn’t really get me anywhere. Everything seemed to be running just fine.

I just removed the Analytics javascript snippet from the nutrun template and pages started flying again.

I’ve also noticed pages around the web occasionally hanging with the browser’s status bar reading connecting to ssl.google-analytics.com…. This, rather obviously, spills the beans on Analytics, I’d be inclined to conclude. Has anybody else come across similar behavior?

I can’t say I don’t like the Analytics service, it’s rich and rather professional, although I’ve been looking for a reason to give Google one less free pass for spying on our traffic, and I guess I found it.

9 Responses to “Does Google Analytics make your pages slow?”

  1. Paul Ingles Says:

    I’ve used both Google Analytics and Mint (Shaun Inman’s PHP creation).

    I have to say, I think Google gives way more information about what users actually visit (and how they visit). But, I find I use Mint more often – it just gives me a nice summary of bits. So, I can see my Feedburner stats, the number of visits, the searches people get referred to my site via. etc.

    And although it’s not free (as in beer ;), it’s pretty reasonably priced. If you want to give it a go, it’s at http://www.haveamint.com.

  2. Zach Smith Says:

    Where did you have the google analytics code? If you had it at the top of your page then that was the problem. The documentation tells you to put it as close to the end (but before the ) as you can get it.

    The reasoning is that when it gets to that script function call to register the hit to your site, it will stop all the other processing, thus slowing down your site. If its at the bottom, it will run after everything has been drawn.

  3. Chris Says:

    Zach, thanks for the tip. That seemed to help my sites. I didn’t run any benchmarks but the pages “seem” to load quicker.

  4. Erinc Says:

    I do believe Google analytics can cause a very short delay. but, since the analytics script should be placed just before the end body tag, it shouldn’t delay the load of the layout that much.

  5. Blizz Says:

    TBH I did 2 things, put it near the bottom of the page _and_ download the script itself to my server. I have code that checks once a week if an updated version is available. It’s probably not needed anymore, but when they first started with analytics, sometimes the server passing out the script couldn’t handle the load.

  6. Vladimir Says:

    Well I used at the starting of my project Google Analytics.
    But as I wanted to have a really small site, the decision was made to kick it off.
    It is 5,4 KB heavy.
    So that is about 20 percent of the homepage.

    Now I use shinystat.
    I know it is not as great as Analytics, but therefore it is only 500Bytes small.

  7. Tim Says:

    I’m sure the Google instructions used to say insert in the header- they must have recently changed this?
    Tim http://bla.st/

  8. Get Rid of Google Analytics » resist - cleveland design Says:

    [...] The allure of free is hard to resist, I tried it myself a week before pitching it. The interface is nice, but not as rich (or as extensible) as Mint. The whole week Google Analytics was continually going down, causing my site to hang. Apparently, I’m not the only one fed up either. [...]

  9. Agreed with Nutrun. Removing Google Analytics removes speed penalty :: pz :: Says:

    [...] http://nutrun.com/weblog/does-google-analytics-make-your-pages-slow/ [...]