Most web analytics starts in the browser: a small script runs on each page and reports what happens. Server-side tracking moves some or all of that reporting to code you control on your server. The event is created where the action really happened, such as the moment your database saves a new account or your billing code records a charge.
Browser tracking and server tracking compared
| Browser script | Server-side | |
|---|---|---|
| Sees page views, scrolling, clicks | Yes | Only page requests your server answers |
| Knows the referrer and campaign tags | Yes, from the page | Only if you pass them on |
| Affected by ad blockers | Sometimes | No |
| Sees bots that never run JavaScript | No | Yes |
| Good for | Visits and behaviour | Confirmed actions: payments, sign-ups, crawler requests |
Neither is complete on its own. A server does not know which tab a person scrolled or which link they clicked to arrive. A browser can be blocked, closed early or never run your script at all.
Common uses
- Confirmed conversions. A sign-up button click in the browser is not the same as an account your backend actually created. Sending the goal from the server counts only real ones.
- Payments. Revenue belongs on the server, where you already know the amount, currency and order id.
- Crawlers. Search engines and AI crawlers usually fetch HTML without running JavaScript, so only your server sees them.
- Apps and back-office tools with no web page to put a script on.
How Reveata handles it
Reveata uses both sides. The tracking script records visits, sources and behaviour in the browser. From your backend you can:
- record a goal with
reveata events sendor the API, using a website API key with thegoals:writescope. Pass the visitor id from the browser (reveata.visitorId()) so the goal is credited to the visit that led to it, and a timestamp up to 30 days in the past (send goals from your server); - send payments through the Payments API when your provider is not one Reveata connects to directly. Sending the same
transactionIdtwice does nothing, so retries are safe; - forward crawler requests so bots that never run JavaScript appear on the bot traffic page.
To get the script itself past blockers, serve it from your own domain with a first-party proxy. That is still browser tracking, just routed through your server.
Pitfalls
- Lost context. A server event without a visitor id cannot be tied to a source. Pass the id from the browser into your forms or checkout metadata.
- Double counting. If both the browser and the server send the same goal, you count it twice. Pick one source per event.
- Personal data. Server code often has names and emails at hand. Only send what you need, and only when your privacy notice allows it.
- Secrets. Server keys must stay on the server. Never put a website API key in front-end code.