TSTrackStack
HomeDocsPricingBlogChangelogSign inGet started
Back to blog
EngineeringMay 5, 2026·4 min read·TrackStack Team

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.

  • deduplication
  • event_id
  • Meta CAPI
  • Google Ads

On this page

  1. Why duplicates happen
  2. The shared event_id pattern
  3. Platform-specific nuances
  4. Operational checks
  5. Testing dedup before launch

Problem: You added Meta CAPI alongside the pixel. Conversions spiked overnight — but revenue did not. The ads manager shows duplicates and your optimization targets are wrong.

Why duplicates happen

When browser and server both report Purchase for the same checkout, ad platforms count it twice unless you explicitly deduplicate. Meta uses event_id. Google uses order_id or transaction ID in upload conversions. TikTok uses event_id.

The failure mode is common: engineering adds server-side tracking, marketing keeps the pixel, nobody coordinates IDs. Both paths fire independently with different identifiers.

Dedup is not automatic — you must design IDs at the business-event layer, not per transport.

The shared event_id pattern

Generate one ID at the moment of conversion — a UUID, your order ID, or a deterministic hash of transactionId + eventName. Pass it to both the browser capture and the server/edge delivery. Meta collapses matching events within its dedup window when event_name, event_time, and event_id align.

Use a stable ID tied to the business event, not a random value generated separately on client and server. transactionId works well for purchases; for SignUp, use a server-generated ID returned in the API response.

const eventId = `purchase_${order.id}`;

trackstack.capture("Purchase", {
  email: order.email,
  value: order.total,
  currency: "USD",
  transactionId: order.id,
  eventId,
});

Platform-specific nuances

Meta requires event_id on both pixel and CAPI events with matching event_name and close event_time for optimal dedup. Large time gaps reduce match confidence.

Google deduplicates on order_id in Enhanced Conversions and offline conversion uploads. GA4 ecommerce uses transaction_id with separate rules — do not assume one ID covers all Google surfaces.

TikTok Events API follows Meta-like event_id patterns. LinkedIn dedup is less documented — prefer a single authoritative delivery path or consistent timestamps.

Operational checks

Audit delivery logs for the same eventId with HTTP 200 on browser and server — that is expected. Flag the same transactionId with different eventId values — that is a bug.

Add code review rules: every conversion capture() includes eventId. Missing IDs are silent until ads manager shows inflated counts.

Document canonical events in Events so product and growth use the same names across SDK, docs, and dashboards.

Testing dedup before launch

Fire a test purchase with a fixed eventId from staging. Confirm one attributed conversion in Meta Test Events and one row per platform in TrackStack delivery logs.

Compare attributed conversions to billing for a 24-hour window after launch — not just pixel helper green checks.

Key takeaways

  • Browser + server without shared IDs double-counts conversions in ad platforms.
  • Generate one `eventId` per business event and pass it to every delivery path.
  • Use delivery logs to catch mismatched IDs before they skew optimization.

Sources

Official documentation and references cited in this article.

  • Meta — Deduplicate pixel and server events
  • Meta — Conversions API overview
  • Google Ads API — Upload click conversions
  • TikTok — Events API

More in Engineering

Engineering4 min read

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.

Read post
Engineering4 min read

Why 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 post
Engineering4 min read

Dead-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 post

Ready to fix your conversion pipeline?

Install the TrackStack SDK, route events to Meta and Google, and verify delivery from one dashboard.

Get started freeView quickstart

© 2026 TrackStack. First-party conversion infrastructure.

DocsPricingBlogChangelog