First-party conversion tracking vs third-party pixels
Browser pixels and server-side CAPI solve different problems. Here is when to use each, how they complement each other, and what breaks when you rely on scripts alone.
- first-party
- CAPI
- Meta pixel
- deduplication
Problem: Your team runs Meta and Google pixels in the browser, but Stripe shows more purchases than either platform attributes. Engineering wants to add server-side tracking without duplicating events or breaking attribution.
Two delivery paths, one conversion
Third-party pixels fire from the browser: a script loads from connect.facebook.net, reads cookies, and sends an event directly to the ad platform. Server-side conversion APIs (CAPI) send the same event from your backend or an edge worker, typically with hashed user identifiers.
These are not either/or. Meta, Google, and LinkedIn all recommend running browser and server events together, then deduplicating on a shared event_id. The browser path captures click IDs and session context; the server path survives ad blockers and cookie restrictions.
TrackStack routes both through a first-party edge endpoint so your app never depends on third-party beacon domains for revenue events. See the quickstart for install and your first verified delivery.
What pixels do well
Client-side pixels excel at capturing _fbp, _fbc, gclid, and UTM parameters at the moment of conversion. Ad platforms use these for click-to-conversion matching. If you only send server events with an email hash, match rates drop — especially for logged-out users.
Pixels also require no backend changes for basic pageview tracking. Marketing can paste a snippet; engineering moves on. That convenience is real, and it is why pixels persist despite their fragility.
The operational gap is verification: pixels do not expose HTTP status from Meta or Google. You need delivery logs on the server path to know whether optimization data is complete.
// Browser capture — preserves click IDs the pixel would read
trackstack.capture("Purchase", {
email: user.email,
value: 1299,
currency: "USD",
transactionId: "txn_001",
eventId: "evt_purchase_001", // shared with server for dedup
});Where pixels fail
Ad blockers, Safari ITP, and Firefox ETP block or truncate third-party requests. Consent banners suppress firing until users opt in. Single-page apps often fire pageviews before the router settles, producing duplicate or missing events.
None of this is a configuration bug — it is structural. A <script> tag cannot guarantee delivery. When the pixel silently fails, your ad platform optimizes on incomplete data and you pay for traffic that never gets credited.
For a deeper look at filter lists and network blocking, read Why ad blockers break third-party pixels.
The first-party middle ground
First-party tracking sends events to your own domain — edge.yourdomain.com or a proxied path like /_ts — then forwards server-side to ad platforms. The browser request looks like same-origin traffic, so block lists rarely intercept it.
A tracking SDK handles both sides: client capture for click IDs, edge routing for CAPI delivery, and shared eventId for deduplication. You keep the developer ergonomics of a pixel without the delivery gap.
Configure destinations and event allowlists in Settings → Configure after connecting platform credentials.
import { createTrackStack } from "@trackstack/sdk";
export const trackstack = createTrackStack({
publicKey: process.env.NEXT_PUBLIC_TRACKSTACK_KEY!,
});Implementation checklist
Install the SDK and fire canonical events (SignUp, Purchase, StartTrial) from business logic — not from GTM triggers disconnected from your types.
Generate one eventId per conversion and pass it to every delivery path. Confirm dedup in delivery logs before scaling spend.
Keep the pixel for click ID capture if marketing requires it; treat server-side delivery as the source of truth for optimization.
Sources
Official documentation and references cited in this article.
More in Engineering
Event deduplication between client and server
Sending the same conversion from browser and server without a shared event ID double-counts in ad platforms. Here is how dedup works at Meta, Google, and TikTok — and how to implement it in your app.
Read postWhy ad blockers break third-party pixels
uBlock Origin and filter lists like EasyList block requests to `facebook.net` and `google-analytics.com` by default. Understand the mechanism so you can design tracking that actually delivers.
Read postDead-letter queues and delivery monitoring for conversion APIs
CAPI endpoints return 429s, 500s, and invalid payload errors. Without retries and a dead-letter queue, failed conversions vanish. Here is what to monitor and how to alert on delivery health.
Read postReady to fix your conversion pipeline?
Install the TrackStack SDK, route events to Meta and Google, and verify delivery from one dashboard.