Client vs server tracking: pros, cons, examples
Tracking placement trade-offs with examples.
Client-side wins on UI context but loses data to blockers and tampering; server-side wins on reliability and trust but misses pure UI events.
Picking one for everything.
WHY IT MATTERS Placement decides whether an event is complete, reliable, and trustworthy. The right answer is per event, weighing context against reliability.
WHAT IT TESTS Whether you can articulate concrete pros and cons and assign events correctly.
A GOOD ANSWER COVERS Client-side tracking runs in the browser or mobile app. Pros: it naturally captures interface context, clicks, page or screen views, scroll depth, hovers, and viewport and device details, and it can fire before any backend call. Cons: ad blockers and privacy settings drop a meaningful fraction of events, flaky networks and page-close cause loss, and a determined user can spoof or replay events, so it is unreliable for anything that must be exact. Server-side tracking runs in your backend. Pros: it is reliable being immune to ad blockers and supporting retries, secure and authoritative since the user cannot tamper with it, and it sits next to your source-of-truth business data. Cons: it is blind to purely client interactions that never hit the server, and it loses device or UI context unless the client forwards it.
WHEN IT MATTERS Use client-side for engagement and interface signals where some loss is acceptable; use server-side for accuracy-critical, trusted, revenue-bearing events. Mature stacks blend both and reconcile identities.
COMMON WRONG ANSWERS Declaring server-side strictly better, since it misses UI behavior. Declaring client-side strictly richer, since it is lossy and spoofable. Tracking revenue client-side where it can be blocked or faked. Ignoring ad blocker impact on counts.
ONE CONCRETE EXAMPLE Best captured on the client: a video_play or button_hover event, a pure interface interaction the server never sees. Best captured on the server: a subscription_renewed event fired when billing confirms the charge, so the revenue record is reliable and tamper-proof regardless of what the client does, and the two streams are reconciled by identity during analysis.
Interview question
Which pairing correctly matches an event to its ideal tracking location?
- a.Track both events client-side for richer device context
- b.Track both events server-side to avoid all data loss
- c.Track a subscription renewal client-side and a button hover server-side
- d.Track a button hover client-side and a subscription renewal server-sideCorrect
Why? this is the answer
A hover is a pure UI interaction the server never observes, while a renewal must be reliable and tamper-proof, so the backend is authoritative. The reversed pairing and single-location options ignore each event's nature.
Just read this? Test yourself on what you have been reading.
Read the original → docs.mixpanel.com
- #event-tracking
- #client-side
- #server-side
- #instrumentation
- #analytics
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles