Server-side tracking for Next.js
Next.js is arguably the best-positioned framework here for server-side tracking. You can proxy a first-party endpoint through a rewrite on your own domain, emit money events from route handlers, and keep the whole thing in one deployment. Very little of that requires separate infrastructure.
Free30 minutesNo obligation
Next.js server-side · what breaks
What goes wrong on Next.js
- 01
App Router navigation isn't a page load
So page-view-bound events fire once and stop.
- 02
Server components run no client effects
Code you expected to execute simply doesn't.
- 03
Events split between server and client
Without a deliberate decision about which does what.
- 04
Hydration timing
Same as any React app.
Next.js server-side · the fix
What changes — Next.js server-side
Route changes emitting events
From a persistent client component.
Money events from route handlers
Server-side, in the same codebase.
A first-party endpoint via rewrite
On your own domain, no separate infrastructure.
Next.js server-side · architecture
What Next.js exposes to a server container
The best-positioned framework in this cluster for doing it properly.
- 1
Money events from route handlers
Server-side, same deployment.
- 2
First-party endpoint via rewrite
Your own domain, no extra infrastructure.
- 3
Cookies set in middleware
In an HTTP response, so Safari's script cap doesn't apply.
- 4
Backend ID as the deduplication key
Issued where the transaction is recorded.
- 5
Consent enforced server-side
Before dispatch.
Next.js server-side · diagnose
Where Next.js tracking breaks, in diagnostic order
Each check rules out a class of cause, so by the last one there is usually a single explanation standing.
- 01
Navigate between routes and watch for events
One event then silence is the App Router signature.
- 02
Check whether tracking code sits in a server component
Effects there never run.
- 03
Confirm where the money event is emitted
Client or route handler.
- 04
Check whether cookies are set in middleware
The difference between 7 days and 400 in Safari.
- 05
Reconcile against backend records
For a closed month.
Next.js server-side · prove
The QA evidence — Next.js server-side
Run on Next.js specifically, on a live conversion rather than in preview mode.
Source of truth
your backend order or CRM records
- Route changes confirmed emitting events across App Router navigation.
- Money events confirmed arriving from a route handler.
- First-party cookies confirmed persisting past seven days in Safari on a real device.
- Endpoint confirmed served from your own domain via rewrite.
- Counts reconciled against backend records for a closed month.
- Reconciled over a fully closed window, matched per record rather than on totals.
- Re-checked 30 days later, and after any platform update.
Next.js server-side · free audit
What we check in the free audit
- Navigate between routes and watch for events
- Check whether tracking code sits in a server component
- Confirm where the money event is emitted
- Check whether cookies are set in middleware
- Reconcile against backend records
Checked against
your backend order or CRM records
Free30 minutesNo obligation
Next.js server-side · when not to buy
When you don't need this on Next.js
Worth reading before you buy anything, from us or anyone.
- If your Next.js app already emits route-change events and sources money events server-side, you've done the work.
- Your engineers can do all of this in their own codebase, and on Next.js it's less work than on any other framework here.
- The rewrite trick is publicly documented and takes an afternoon. You may not need help with it.
- Reconcile against your backend before assuming anything is broken.
Next.js server-side · what we deliver
What the server-side build gives you on Next.js
Container on your own subdomain
Your domain, your certificate, hosting in an account you control.
Money events from your backend records
A Next.js route handler or server action, emitting the event where the transaction is recorded.
Deduplicated at every destination
On a shared event ID, verified before any existing path is removed.
Consent enforced before dispatch
A denied destination receives nothing, verified by capture rather than configuration.
Written guarantee
95%+ tracking accuracy
Measured against your backend order or CRM records. Miss it and we keep working at no cost.
Pricing
Pick the package that fits your ad spend
Browser-side starter
$400One-time fee · lifetime ownership
Repairs and verifies the browser-side setup you already have, on a live conversion. Honest about its ceiling on this platform.
- Root cause fixed, not worked around
- Verified on a live conversion
- Reconciled against your own records
- Written handover
1st-party server-side
Recommended$800One-time fee · most popular
Money events sent from your own records through a first-party container on your subdomain, so the browser can no longer lose them.
- First-party server container on your own subdomain
- Money events from your records, not the browser
- Deduplicated on a shared event ID at every destination
- First-party cookies beyond Safari's 7-day cap
- 95%+ accuracy and 8+ Meta EMQ, guaranteed in writing
Full 1st-party stack
$1,800One-time fee · lifetime ownership
Every paid channel server-side plus the offline loop, with monitoring so the next break surfaces in days.
- Everything in 1st-party server-side
- Pinterest, Snapchat, Reddit and LinkedIn CAPI
- CRM and offline conversion loop
- Refunds and cancellations corrected wherever each platform allows it
- Monitoring on every destination
FAQ
Next.js server-side questions, answered
The best-positioned framework in this cluster. You have a server in the same codebase, rewrites for first-party serving and middleware for cookies.
Often not. A rewrite plus route handlers covers a lot of what a container would do.
Set them in middleware, in an HTTP response. The seven-day script cap applies to document.cookie, not to Set-Cookie.
A backend-issued ID from wherever the transaction is recorded.
Free · 30 min
Move Next.js events off the browser
Free30 minutesNo obligation
