3 ms·
The challenge with any server-side solution is the huge amount of caching that takes place within the web infrastructure. Many sites sit behind CDNs, but even w
by danyork 8y ago
The challenge with any server-side solution is the huge amount of caching that takes place within the web infrastructure. Many sites sit behind CDNs, but even without CDNs, many ISPs and enterprises run their own caching proxy servers on the edge of their networks. Browsers also have their own caching of recent pages. The result of all the caching is that it is possible that very few of the visitors actually connect to the origin server.
For that reason, most analytics systems use come kind of client-side tracking code that runs within the client web browser. That way it works regardless of whatever caching happens.
- darekkay 8y agoServer-side analytics is not a silver bullet, but it's great for the quoted use case. While it has the mentioned disadvantages, so do client-side solutions. Many people run adblockers and it's easy - sometimes even a default - to simply block Google Analytics & co. So yes, if you really need exact statistics, you should probably run both client-side and server-side analytics. But for a rough "what's popular?" estimate, there's no need to impose (one more) JS file on your users. I've switched from GA to GoAccess a few years ago (running both for a few months), and while the absolute numbers were off by ~10%, the ratio was almost the same. But then again, I'm just running a blog and not a business.