> Site index: https://usehardal.com/llms.txt
> Every content route also serves markdown at <url>.md

# Client-Side vs Server-Side Tracking: Key Differences

Client-side tracking sends events from the browser or app straight to each vendor. Server-side tracking routes them through a server you control first.

Source: https://usehardal.com/glossary/client-side-vs-server-side-tracking

---

Client-side tracking sends events from the visitor's browser or app directly to each analytics or advertising vendor. Server-side tracking sends events first to a server the business controls, which checks them and forwards the permitted fields to each destination. The difference is where the data is processed and who decides what leaves.

Most teams do not choose one. They decide, event by event, which path is the source of truth. For a full introduction to the server-side approach, read [What Is Server-Side Tracking?](https://usehardal.com/server-side-tracking). This page focuses on the comparison.

## How each approach works

**Client-side.** A JavaScript tag, pixel, or mobile SDK runs on the device. When the visitor acts, the tag builds a request and sends it to the vendor's domain, such as `google-analytics.com` or `facebook.com/tr`. Each vendor's script decides what it reads from the page and what it sends.

**Server-side.** A tag on the device, or your backend, sends the event to an endpoint you run, often on a subdomain like `metrics.example.com`. That server validates the event, removes fields you do not want to share, adds backend values such as order margin, and calls each vendor's API. [Server-side GTM](https://usehardal.com/glossary/server-side-gtm) is one common way to run this server. A direct call from your order service is called server-to-server delivery.

## Side-by-side comparison

| Question | Client-side tracking | Server-side tracking |
|---|---|---|
| Where is the event processed? | On the visitor's device | On a server you control |
| Who decides which fields are sent? | Each vendor's script | Your server configuration |
| Can it see backend data, such as refunds or margin? | No | Yes, if your systems send it |
| Exposure to domain blocklists | Higher, requests go to known vendor domains | Lower, requests go to your own domain |
| Page weight | Grows with each vendor tag | One collection request can feed many destinations |
| Hosting cost | None for you | A real infrastructure line item |
| Consent duties | Apply | Apply in exactly the same way |

## What changes for cookies and identifiers

Safari caps cookies written by JavaScript with `document.cookie` at 7 days. A cookie set in an HTTP `Set-Cookie` response from your own server is a different mechanism and is not subject to that JavaScript cap. Safari also limits cookies from servers it treats as third-party or as cloaked behind a CNAME, so the result depends on how the endpoint is hosted. Test the real cookie lifetime in Safari before you rely on it. Our [Safari ITP guide](https://usehardal.com/safari-itp-guide) covers the details.

## Common pitfalls

- **Double counting.** The browser pixel and the server both send `Purchase` for order `1001`. Without a shared `event_id`, Meta or TikTok may count two purchases. See [event deduplication](https://usehardal.com/glossary/event-deduplication).
- **Assuming the server recovers lost events.** If the browser never detected the action, the server never receives it. Server-side processing improves control, not detection.
- **Moving consent logic to the wrong place.** The server should read the consent state that arrives with each request and drop or trim fields when consent is missing.
- **Mismatched definitions.** If the browser `purchase` fires at checkout start and the server `purchase` fires at payment capture, the two sources will never agree. That gap shows up as a data discrepancy between tools.

## How Hardal helps

Hardal is the first-party data and agentic analytics platform. It runs the server layer for you on your own first-party subdomain and forwards events to destinations such as GA4, the Meta Conversions API, the TikTok Events API, and Google Ads. You keep client-side collection where it is needed, and Hardal applies the same event rules and consent state on the server. The [destinations list](https://usehardal.com/destinations) shows every supported integration.

**Related terms:** [Server-side measurement](https://usehardal.com/glossary/server-side-measurement), [Server-side GTM](https://usehardal.com/glossary/server-side-gtm), [Event deduplication](https://usehardal.com/glossary/event-deduplication)
