
What to Move Server-Side, and What to Keep
A criteria-driven decision matrix for splitting a tag stack server-side vs client-side — what to move, what stays in the browser, and how to phase the migration.
TL;DR: Server-side tagging is not an all-or-nothing migration — the end state this article argues for is hybrid, where some tags move to the server and others stay in the browser on purpose. The decision is per-tag-class, driven by three criteria that push work server-side (data control, performance, durability) and three cases that keep it client-side (it needs DOM, click, or viewport context that only exists in the browser; it drives real-time UX; or it exists to observe the client). This gives you a criteria-driven matrix and a way to sequence the move without a measurement blackout — and a warning about double-counting during the transition.
Why it is not all-or-nothing
A framing that wastes a lot of effort is treating server-side tagging as a single switch you throw for the whole stack. It does not have to be. A setup can keep some tags client-side and move others server-side, because the tags in a stack do genuinely different jobs and not all of those jobs survive the move.
So the useful question is not "should we go server-side?" but "which tag classes belong server-side, and which stay in the browser?" That is a per-tag-class question, asked once per class of tag rather than once for the whole container. An analytics collector, an ad-conversion tag, and a session-replay tool are not the same kind of thing, and a verdict that fits one will be wrong for another.
This article sets up the decision as criteria-driven rather than as a universal verdict. There is no list of tags that "should" be server-side in the abstract. There are criteria, and the criteria — applied to your specific tags, your specific stack — produce the placement. The rest of this is those criteria and how to apply them.
Criteria that push a tag server-side
Three properties make a tag a good candidate to move. They tend to compound: a tag that scores on more than one is a stronger candidate than one that scores on a single criterion.
The first is data control. If you want to inspect and shape a tag's payload before it reaches the vendor — strip fields, correct values, enrich from server-side context, decide what each destination receives — that work has to happen somewhere you control, and the browser is not that place. Moving the tag server-side puts the payload through a tier you own before fan-out.
The second is performance. If a tag is heavy on the client — large scripts, multiple network round-trips, work that competes with rendering — moving its fan-out off the browser removes that weight from the page. The relevant point for placement is that some tags carry real client cost and others are trivial, and the heavy ones gain more from the move. web.dev's guide to efficiently loading third-party JavaScript explains how synchronous third-party scripts delay DOM construction and rendering, which is useful background for judging how much a given tag actually costs the client; the decision here is comparative, not absolute.
The third is durability. Collection can benefit from first-party context under tracking prevention, and tags whose value depends on a persistent identifier can gain durability when collection moves first-party. Browser tracking prevention — documented in places like WebKit's Tracking Prevention documentation (as of November 2026, and worth re-checking because it changes) — is the pressure that makes this criterion matter, because it is the client-side surface that erodes: WebKit's Intelligent Tracking Prevention (ITP) deletes all cookies created in JavaScript and all other script-writable storage after 7 days of no user interaction with the website; the first-party domain of a home screen web application is exempt from that 7-day cap. ITP also blocks third-party cookies by default. The gain is conditional on how the endpoint is hosted, though. Per the same documentation, ITP caps the expiry of cookies set in HTTP responses at 7 days when it detects third-party CNAME cloaking or third-party IP address cloaking. The documentation defines third-party CNAME cloaking as a first-party subresource that resolves through a CNAME that differs from the first-party domain and differs from the top frame host's CNAME, if one exists. So a first-party hostname does not settle it on its own: what the collection subdomain resolves to decides whether the cap applies. The grounding for why first-party context is more durable is how browsers restrict third-party cookies: MDN's guide to HTTP cookies notes that browser vendors have all started to block third-party cookies by default, or at least made plans to go in that direction, and that browser settings or extensions may also block them.
Criteria that keep a tag client-side
There is one criterion that overrides the others, and it is worth stating as a rule because it settles a lot of cases on its own: a tag that needs DOM, click, or viewport context that only exists in the browser stays client-side. The server does not observe a hover, a scroll depth, a rage-click, or which element was in view; it learns of them only if browser-side code captures and sends them. If the tag's job depends on capturing that context, the job cannot move, and no amount of data-control or durability appeal changes that.
A second case is real-time UX. A tag that drives something the user sees immediately — render-blocking personalization, an on-page experience that must change before the next paint — lives where the rendering happens. Routing that through a server round-trip either breaks the experience or adds latency the user feels. The browser is not a limitation here; it is the correct location.
The third case is tooling that fundamentally observes the client. Session replay and similar tools exist to record what happened in the browser — interactions, layout, client-side errors. Their entire subject is the client. Moving them server-side does not make them more durable; it removes their ability to do their job. These stay client-side by definition, not by trade-off.
A per-tag-class decision matrix
With the criteria in hand, the matrix is the working artifact. It is deliberately a set of leans, not verdicts — each row names the criterion that decides it, and context can move a row either way. Read the lean as "where this usually lands and why," then apply the criteria to your own instance.
| Tag class | Usual lean | Deciding criterion |
|---|---|---|
| Web / product analytics collection | Server-side | Data control and durability — you want to own and shape the payload, and collection can gain from first-party context |
| Ad-conversion tags | Server-side or hybrid | Durability under tracking prevention; often run hybrid for coverage, which makes deduplication mandatory |
| Marketing / tracking pixels | Hybrid | Durability pushes server-side, but some pixels still expect a client-fired call — split case by case |
| A/B testing and experimentation | Client-side | Real-time UX — the variant must apply before the user sees the page |
| Personalization (render-affecting) | Client-side | Needs DOM and immediate render; server round-trip breaks the experience |
| Session replay | Client-side | Fundamentally observes the client — DOM, interactions, viewport |
The pattern across the rows is the same rule from the previous section made explicit: anything whose value comes from client context stays in the browser, and anything whose value comes from owning, shaping, or durably delivering the payload is a candidate to move. The matrix does not relieve you of judgment — it is criteria-driven, and context decides the final placement. There is no single universal answer that fits every stack, and a row that leans one way for a content site can lean the other for an app.
Sequencing a phased migration
Once you know what is moving, the move itself is staged, not flipped. The goal that shapes the sequence is no measurement blackout in between — at no point should an event class stop being collected because it is mid-migration. Each stage leaves you with working measurement, just with more of it server-side than before.
Order the stages by criterion, not by calendar. The lowest-risk, highest-control-gain classes go first: the analytics collection you most want to own, with the least dependence on fragile client context, is a better opening move than a tangle of ad pixels with vendor-specific quirks. "Lowest risk first" is a selection criterion you apply to your own tags, not a fixed schedule.
And validate each stage before starting the next. After a class moves, confirm its event volume matches what it produced before the move — within the variation you would expect — so that a drop is caught at the stage that caused it rather than discovered much later across a stack where you can no longer tell which change broke it. A stage that does not reconcile is a stage you do not build on.
The dual-tagging transition risk
There is one failure mode specific to the transition itself, and it is worth naming because it is predictable. During a migration, a tag often runs client-side and server-side at the same time — the old path still live while the new one is validated. If both paths report the same event, the vendor can count it twice.
Double-counting is a transition risk specific to running two paths, and it inflates conversion and event totals in a way that looks like a win until someone reconciles the numbers. It is not a sign the migration is wrong; it is the expected consequence of running two paths without coordinating them. The fix is not to rush to a single path — the overlap is sometimes deliberate, for coverage — but to make the two reports recognizable to the vendor as the same event. That mechanic, the shared event identifier and match key that lets a vendor merge two reports into one, is covered in another article on this topic; here it is enough to know the risk exists and that a deliberate transition plan contains it.
That is the argument for planning the move rather than discovering it. A migration sequenced by criteria, validated stage by stage, with the double-counting risk anticipated, contains its own failure modes. A migration done as a single switch finds those failure modes in a report, after the data is already wrong.