最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What's the advantage of client-side analytics over server-side? - Stack Overflow

programmeradmin1浏览0评论

I've always used client-side web analytics that uses JavaScript to track visitor hits to the site, and all the useful information that gives. But some people have recently told me they prefer server side analytics because it's faster.

So what I wondered is what are the main advantages of doing it client-side with JavaScript? Which has more features and why?

I've always used client-side web analytics that uses JavaScript to track visitor hits to the site, and all the useful information that gives. But some people have recently told me they prefer server side analytics because it's faster.

So what I wondered is what are the main advantages of doing it client-side with JavaScript? Which has more features and why?

Share Improve this question edited Nov 21, 2011 at 20:22 Michael Durrant 96.6k101 gold badges347 silver badges531 bronze badges asked Nov 21, 2011 at 11:19 David BallDavid Ball 5639 silver badges20 bronze badges 4
  • 1 I don't really understand your question. the recording/displaying of any soft of analytical data would involve both client and server side. – Tim B James Commented Nov 21, 2011 at 11:22
  • 1 @Tim, I think it's a distinction between analysis of server logs (e.g. Webalizer) that doesn't require anything to run on the client, as opposed to having something running on the client side (e.g. Google Analytics) that don't rely on your server logs at all (but uses a client script to call another central logging server). – Bruno Commented Nov 21, 2011 at 11:30
  • 1 When I say server-side, what I mean is a solution created entirely in PHP for example, with nothing showing in the HTML. You have to add JavaScript to a page when adding Google Analytics, this is a minor drawback in terms of speed which might sway certain people away from Google Analytics. What I'm asking is what are the advantages of a JavaScript solution like Google Analytics pared to a server based one like Webalyzer (webalizer) or bbclone (bbclone.de). – David Ball Commented Nov 21, 2011 at 11:34
  • 1 Bruno, server log analysis certainly has its place but in this case I believe we're talking about general data analysis to produce analytics and whether this is actually done on the client or done on the server and then pushed over (often as just images of graphs, etc.) to the client. – Michael Durrant Commented Nov 21, 2011 at 17:00
Add a ment  | 

3 Answers 3

Reset to default 7

Server or Client side for Analytics?

Server-side Advantages:

  • Servers can be set up with infinitely more power than desktop machines and so can crunch "the big numbers".

  • Performance can be more predictable as the same machines are used for everyone's analysis and generation of results.

  • Output will not have dependencies on browser / browser version as they just have to display an image.

  • Output can also be multi-device without any dependencies.

  • Output can be the same everywhere both reducing client issues and also making the image generation be about supporting 1 output format over many.

Client-side Advantages:

  • If the number of clients is large, say thousands per minute, it can be good to unload the processing to client machines to avoid having them slow down a central server.

  • Solutions tend to provide more interactivity and faster results as all the data and the logic is on the client.

  • Once downloaded initially, views can be changed without being online.

  • If the traffic varies a lot, say sometimes a few queries per hour, other times, hundreds per minute client-side makes sure that a central server is not over-loaded by this effort

  • Server-side infrastructure will not be needed and so will not cost (the provider) money.

Many panies use both Google Analytics (client side) and Webtrends (server side/client side) to do web analytics.

One thing about Google Analytics is that it doesn't work when the user doesn't allow scripts. Webtrends can crawl your access logs.

Client-side tracking provides more information in parison with server-side tracking.

发布评论

评论列表(0)

  1. 暂无评论