Skip to main content
FHAVI

Free resource

The server-side tracking checklist, in build order

Server-side tracking fails quietly. A pixel that is blocked is obvious within a day; a forwarder that rejects every purchase returns 200 and reports nothing. This is the order we build in, and the checks that catch a silent failure before it reaches an ad account.

Before you build

Decide what the server is allowed to send

The server exists to solve two problems the browser cannot: events lost to blockers and tracking prevention, and identity lost when cookies do not survive. It is not a second copy of every event for its own sake — duplicating everything doubles your maintenance and your risk without improving match quality.

The usual split is: browser sends the browsing events, the server sends the events that matter commercially and the identity-heavy ones — purchase, and any lead that carries a phone number or email. Anything that only makes sense mid-session can stay in the browser.

Write that split down before you write code. Every later decision follows from it.

Step 1

Credentials, stored where the bundle cannot see them

01

Access and secrets

  1. A Conversions API access token generated from the dataset, not a personal Facebook login.
  2. The token lives in server environment variables or an encrypted settings row — never in a client bundle, never in a public config endpoint.
  3. A GA4 Measurement Protocol API secret exists if you are sending purchases server-side.
  4. The public config endpoint returns only identifiers that are safe to publish: measurement id, pixel id, container id. No tokens.
  5. Someone else can rotate the token without a code deploy.

Step 2

Event parity, one event at a time

02

What must exist server-side

Name them, then prove each one arrives.

  1. Purchase fires from the order-confirmation path, for every payment method, exactly once.
  2. The event id is the order number, so a retry, a refresh or a double-click cannot create a second sale.
  3. Value equals the order total the customer actually pays, in the store's real currency.
  4. Content ids refer to catalogue ids, so the same product joins across events and ad sets.
  5. Refund, cancellation and delivery states are sent as their own events — a placed order is not a delivered order in a cash-on-delivery market.
  6. Leads that happen outside a form submission — a WhatsApp tap, a waitlist signup — are sent, because those are conversions even when nothing is bought on the site.
03

What should stay in the browser

Adding these server-side is effort without return.

  1. PageView and scroll or engagement signals — they describe a session the server cannot see.
  2. Any event whose only purpose is on-page UX measurement.
  3. Duplicates of browser events that already carry a matching event id, unless you have a measured reason.

Step 3

Identity, hashed the way the platform expects

04

Match quality

This is where server-side tracking earns its money — or wastes it.

  1. Email is lowercased and trimmed before hashing, otherwise the hash will not match the platform's.
  2. Phone is normalised to E.164 with the country code, then hashed — the format customers type is never the format the platform expects.
  3. First name, last name, city, postcode and country are hashed if you send them; unhashed values are silently dropped.
  4. Client IP and user agent come from the real request, not a proxy header a client can spoof.
  5. _fbp and _fbc are forwarded when present, and _fbc is reconstructed from an ad click's fbclid when the cookie is missing.
  6. A stable internal customer id is sent as external id, so repeat buyers join across sessions.

Step 4

Deduplication, which is the whole point

05

One action, one id

  1. A single event id is generated once per action and passed to both senders — not generated separately in each place.
  2. The server receives the browser's id rather than inventing its own.
  3. Meta merges browser and server events within 48 hours when event name and event id agree.
  4. Test with one real order and confirm Events Manager shows one event with two sources, not two events.
  5. GA4 purchase uses a transaction id, and the same transaction id is used by every sender.
06

Failure modes to test for

  1. Double counting: two ids for one order. Revenue looks better than reality and bad campaigns look good.
  2. Silent loss: the forwarder catches its own errors and returns success, so nothing is logged and nothing arrives.
  3. Retry storms: a network retry resends a purchase because the id was generated inside the retry loop.

Step 5

Verification that does not depend on hope

07

Prove each send

  1. Every outbound send records the event name, HTTP status and the platform's own response message.
  2. Those records are visible to you in a panel, not buried in a server log nobody opens.
  3. A test event code routes test traffic away from live reporting, and is removed when testing ends.
  4. A rejected event shows its reason in plain language — expired token, policy rejection, malformed payload.
  5. After a week of traffic, match quality is reviewed per event and the weakest identifier improved, not ignored.

Keep going

The rest of the library

Every checklist here is free and ungated. The research pages carry the reasoning behind them.

All resources · Research library

Want the install done and proven?

Browser and server-side install is $399–$699, delivered with the send logs and a test order you can inspect yourself.

Prefer email? Write to md@fhavi.com