views:

2896

answers:

15

I like to keep my websites extremely light and fast, but of course I need some kind of user tracking and analytics.

It seems like Google Analytics always takes significant enough processing time that I'd like to replace it with something faster (and/or hosted locally), perhaps having less features.

I really only care about these metrics: browser, OS, referrer, and # hits per page on a given day or week.

Does anyone have any good suggestions, or is Google Analytics really the best option?

+13  A: 

It may be the load time that is the main delay. Try hosting the google analytics javascript file locally.

Liam
A good idea, I didn't consider it before, but I realize I can just use cron to grab the new urchin.js every day. Thanks!
Eric Wendelin
I haven't tested it, but I have read good things about it. It is generally not recommended without a cron job to update it, which rules it out for a lot of shared hosting providers.
Liam
Right. Luckily I can use cron with my hosting provider.
Eric Wendelin
Sometimes it's better to have facilities such as forums tracked by the hoster's solution.
vanslly
hosting locally has the disadvantage of not using the Google CSN anymore. So even it looks for you like it would be an improvement,people on other continents could see a delay, because the Google scripts would not be hosted nearby anymore
kohlerm
Isn't the javascript file only downloaded on the first pageview? Every subsequent pageview would use a cached version.
Chris
If the user has visited any other website using Analytics with urchin.js hosted from Google, then it will be cached in their browser. Downloading it from you will not improve performance.
I Clark
A good tutorial on how to do this can be found on this site:http://www.askapache.com/webmaster/faster-google-analytics-with-a-local-urchinjs.html
sthg
+4  A: 

a good alternative is reinvigorate. It gives you stats in "real time" and (in my opinion) is a little faster, but it doesn't have as many options as g-analytics.

jeds
A: 

You can simply get hold of your logs and analyse them with a tool such as WebLog Expert Lite to get those metrics.

BlackWasp
not the OS though
Liam
+1  A: 

For the metrics you need, you could use the web logs created by Apache/IIS.

You could then remove the analytics code.

pro
A: 

WebTrends is a pretty effective "paid" service ... though I gotta say, the wiz-bang features of Google Analytics are way cooler.

Ken
+6  A: 

I second hosting the GA javascript file yourself - the only downfall is that if google updates the file your copy will be old and you may miss out on certain features - however you could mitigate this by having a script pull down the latest version each week...

The benefit of hosting yourself is you have complete control over caching etc, and there are less DNS lookups required for your site.

The other issue your probably facing is the delay (which is up to 24 hours) for the data to be updated, but for something that costs nothing I'm not complaining too much :)

Matthew Savage
Yes, I *could* just use cron to get a new urchin.js every night. That's a good idea!
Eric Wendelin
I don't think it would be about missing features (you're not going to miss a feature you're not using, after all), but more about security holes getting patched that would be the real problem.
Bobby Jack
+4  A: 

Loading the urchin.js script as the very end of the page shouldn't slow page-loading down (as it will load your web-page, then contact Google Analytics). That also means it wont freeze your page if the urchin.js URL is temporarily unreachable for whatever reason (say, a slow DNS lookup)

Routinely download urchin.js and serving it locally will speed things up too. Updating it once an hour would be more than enough (given that it usually gets one request per page-view, once an hour is trivial)

I guess if you are really concerned, you could look into modifying urchin.js to make it less resource intensive, or working out what it does, and simplifying it (I would recommend checking if someone else has already done this first), but I don't think the JS execution time will be slowing your web-page down noticeably

dbr
I've never quite understood why this is - I guess I don't fully understand the mechanics of a web browser, even at a very high level. Shouldn't the browser spawn a separate thread for each resource it tries to fetch? Or is this what Google Chrome is all about?
Bobby Jack
If a browser executes javascript, it can write HTML into the page as it renders--so the browser needs to download the javascript resource before it can continue rendering.
Chris B.
A: 

I've previously had a quick look at Mint, which looks interesting. But I have no information about the speed, and it costs $30 per site.

TimB
A: 

I'm a fan of Statcounter. It seems less intrusive that some of the free tools I've tried and I've never had it make anything seem sluggish. The log size for free accounts is the last 500 hits, but that's expandable for a fee.

eaolson
A: 

For live tracking you could also try Woopra. It is pretty stable and fast, but only allows for 10.000 pageviews a day currently as they are still in Beta. Thye have some nice feature, like live chat with your visitors.. It'not so good for conversion tracking though, but could be overcome by using good parameters in your url and ads.

+3  A: 

The problem you're experiencing is just standard I/O blocking whilst javascript loads.

Take a look at this solution: http://lyncd.com/2009/03/better-google-analytics-javascript/

This should process the Google Analytics after the page has loaded.

Mark Worth
A: 

AWStats will give you very thorough and well-presented stats just by parsing your log file daily. It also has a lightweight JS for more advanced stats like plugins and screen size.

SpliFF
+8  A: 

You should try Asynchronous Google Analytics. It loads GA in the background, so the rest of the content on the page is not blocked from rendering:

http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html

Additionally, since you first asked this question, Google has upgraded their serving infrastructure. It's now faster, and much more reliable than it was in 2008. For most sites, it's better use Google's CDN instead of hosting ga.js yourself. Most users will have it in their browser cache since it's on so many sites.

Brian
+1  A: 

you can subscribe to Google Analytics JavaScript Tracking Code Changelog
http://code.google.com/apis/analytics/docs/gaJS/changelog.html
to see if a new version is available to update the ga.js locally


I also encounter this new Asynchronous Snippet
http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html
It activates Google Analytics tracking by inserting ga.js into the page. but It takes advantage of browser support for asynchronous JavaScript to enhance the speed in which the tracking code is loaded

imanabidi
+2  A: 

I can't believe, that no one has suggested Piwik. In my opinion, it's THE best alternative to Google Analytics out there. It is also coming to full maturity in a couple of weeks.

You should definitely check it out!

Janis Peisenieks
Hadn't heard of it. Thanks!
Eric Wendelin