Server-side vs client-side analytics
The real differences between server-side and client-side analytics, what each can and cannot measure, and how to get accuracy and privacy without choosing badly.
All posts
Analytics can watch your site from two places: inside the visitor’s browser, or at your server. They measure different things, and most debates about which is better skip that point. Here is the honest comparison.
Client-side analytics
A small script runs in the browser and reports what the visitor actually does: which page loaded, a route change in a single-page app, a click, a custom event. Because it runs where the person is, it can see engagement that never reaches your server.
The trade-off is that a browser script can be blocked, and it needs to be lightweight so it does not slow the page.
Server-side analytics
Here there is no client script. You count requests as they arrive at your server, or parse your access logs after the fact. Nothing runs on the visitor’s device, so nothing can block it, and there is no performance cost to the page.
The trade-off is what it cannot see. Server logs count every bot and crawler, cannot tell a real reader from a script, and have no idea what happened in the browser after the response was sent.
Side by side
| Question | Client-side | Server-side |
|---|---|---|
| In-browser behaviour | Yes | No |
| Route changes in a SPA | Yes | No |
| Blocked by ad blockers | Sometimes | No |
| Counts bots | Filtered | Yes, heavily |
| Page performance cost | Small | None |
| Custom events | Yes | Limited |
Where privacy fits
Both approaches can be private or invasive; the method matters more than the location. A client-side tool that stores no cookie and keeps only anonymous aggregates, like sonex, is private by construction. A server-side setup that logs and retains full IP addresses is not, despite never running a script. Do not assume server-side means privacy-friendly.
A sensible default
For most sites, the question is “how do real people use this”, and a lightweight, cookieless client-side tool answers it best: route-aware, behavioural, and private. Reach for server-side or log analysis as a complement when you need request-level completeness or a second source to cross-check. The point is to match the tool to the question, not to crown one winner.
Frequently asked questions
- What is the difference between server-side and client-side analytics?
- Client-side analytics runs a script in the visitor's browser and can measure real user behaviour like route changes and clicks. Server-side analytics counts requests as they hit your server or logs, with no client script, but cannot see in-browser behaviour and includes bot traffic.
- Is server-side analytics more accurate?
- It is more complete in the sense that ad blockers cannot remove a request from your own logs, but it is also noisier because it counts bots and cannot distinguish real engagement. Neither approach is simply more accurate; they measure different things.
- Which should I use?
- For understanding how real people use your site, a lightweight client-side tool like sonex is usually the right default. Server-side or log analysis is a useful complement when you need request-level completeness or want to cross-check.
sonex is privacy-first web analytics. No cookies, no consent banner, no personal data. Drop one script and read realtime visitors, funnels and a world map in seconds.
Try sonex free