Skip to main content
Next.js + Meta CAPIPlatform solution

Meta Conversions API setup for Next.js

Meta on Next.js benefits most from the rewrite trick — serving the endpoint from your own domain avoids a chunk of blocking — combined with Purchase emitted from a route handler rather than the client.

Free30 minutesNo obligation

Next.js + Meta CAPI · what breaks

What goes wrong on Next.js

  1. 01

    App Router navigation isn't a page load

    So page-view-bound events fire once and stop.

  2. 02

    Server components run no client effects

    Code you expected to execute simply doesn't.

  3. 03

    Events split between server and client

    Without a deliberate decision about which does what.

  4. 04

    Hydration timing

    Same as any React app.

Next.js + Meta CAPI · the fix

What changes — Next.js + Meta CAPI

  • 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 + Meta CAPI · architecture

How Meta tracking behaves on Next.js

Rewrite plus route handler is the strong combination here.

  1. 1

    Endpoint served through a rewrite

    First-party, on your own domain.

  2. 2

    Purchase from a route handler

    Not the client.

  3. 3

    Backend ID as event_id

    Shared with the client Pixel.

  4. 4

    fbclid captured on first load

    Stored and available server-side.

  5. 5

    Customer data server-side

    Normalized before hashing.

Next.js + Meta CAPI · 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.

  1. 01

    Navigate between routes and watch for events

    One event then silence is the App Router signature.

  2. 02

    Check whether tracking code sits in a server component

    Effects there never run.

  3. 03

    Confirm where the money event is emitted

    Client or route handler.

  4. 04

    Check whether cookies are set in middleware

    The difference between 7 days and 400 in Safari.

  5. 05

    Reconcile against backend records

    For a closed month.

Next.js + Meta CAPI · prove

The QA evidence — Next.js + Meta CAPI

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 + Meta CAPI · 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

Get my free conversion tracking audit

Free30 minutesNo obligation

Next.js + Meta CAPI · 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 + Meta CAPI · what we deliver

What gets built for Meta on Next.js

  • A shared event ID on both paths

    A backend-issued order or transaction ID from your route handler, shared with the client Pixel.

  • Standard event names, exactly cased

    Meta matches on name and ID together, so a case difference alone produces two events.

  • Customer data normalized then hashed

    Lowercase and trimmed email, phone in E.164. This is where nearly every low match quality score comes from.

  • fbc and fbp forwarded from the browser

    fbc only exists if fbclid was captured on landing — a very common gap.

Written guarantee

95%+ tracking accuracy

Measured against your backend order or CRM records. Miss it and we keep working at no cost.

Get my free conversion tracking audit

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
Fix what I have

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
Rebuild it server-side

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
Get the full stack

FAQ

Next.js + Meta CAPI questions, answered

Serving from your own domain avoids a meaningful share of blocking. It isn't immunity and nobody should claim it is.

Free · 30 min

Get Pixel and CAPI counting once on Next.js

Free30 minutesNo obligation