Meta Conversions API (CAPI) Deduplication & Match Quality

How to de-duplicate events when working with Meta's CAPI alongside browser pixel tracking.

  • Meta only deduplicates a browser pixel event and a server (CAPI) event when both share the exact same event name (case sensitive) and the same event ID.
  • In the browser pixel, eventID goes in the FOURTH argument of fbq(); putting it in the third argument makes Meta treat it as a custom property and ignore it. On the server, event_id goes at the top level of the event, not inside custom_data.
  • Event ID choice: use the order ID for purchases; use a single UUID per event for everything else. The UUID must be generated in one place (e.g., the browser) and passed to the server, since generating it separately on each side means nothing deduplicates.
  • Set an external ID (user ID, CRM ID, or first-party session cookie) as a fallback; Meta matches on event name plus external ID or fbp when the event ID is missing, but it is weaker and only works if the browser event arrives first.
  • Send server events through a small tracking API endpoint: the browser generates the ID, fires the pixel, then posts the same ID and event name to the endpoint that forwards to Meta. This keeps CAPI logic out of core app code and lets marketers manage events independently.
  • Deduplication only works within a 48-hour window. Send CAPI events immediately, or within an hour at most, to preserve reporting speed and attribution accuracy.
  • Event Match Quality is separate from deduplication. Improve it by sending fbp/fbc (unhashed, from cookies), client_ip_address and client_user_agent (from the visitor's request, not your server), external_id, and hashed em/ph (trimmed, lowercased, SHA-256).
  • Common pitfalls: mismatched event names, event ID in the wrong argument or misspelled, mismatched triggers (e.g., button click vs. payment webhook), and multiple pixels on one domain. Use one base pixel per domain.
  • Never disable the pixel to fix double counting; running both captures events blocked by ad blockers/ITP (via CAPI) and browser context the server can't see (via the pixel).
  • Verify in Events Manager > Test Events: confirm matching browser and server rows with identical event names and IDs, with one marked Deduplicated, then check deduplication details over the following days.

Meta only deduplicates a browser pixel event and a server event when both carry the same event name and the same event ID.

If you want to run the Meta Pixel and the Conversions API together without double counting, every event has to go out twice with matching keys. Here’s how I set that up, and the mistakes I see most often.

What Meta Needs to Match

Parameter Browser Pixel Conversions API Rule
Event ID eventID event_id Identical value on both sides
Event name Second argument of fbq() event_name Exactly the same, case sensitive, including spaces, underscores and dashes
External ID external_id user_data.external_id The fallback when the event ID is missing

Event ID

When one thing happens on your site, like a lead form submit, it creates a browser pixel event and an equivalent server event. The event ID is what tells Meta those two are a single occurrence.

In the browser it’s eventID, and it goes in the fourth argument of fbq(). If you put it in the third argument with your custom data, Meta treats it as a custom property and ignores it for deduplication.

fbq('track', 'Lead', { currency: 'USD', value: 50 }, { eventID: eventId });

On the server it’s event_id, at the top level of the event, not inside custom_data.

{
  "data": [{
    "event_name": "Lead",
    "event_id": "3b241101-e2bb-4255-8caf-4136c566a962",
    "event_time": 1732400000,
    "action_source": "website",
    "event_source_url": "https://example.com/contact/",
    "user_data": {
      "external_id": "HASHED_USER_ID",
      "fbp": "fb.1.1732399000123.987654321",
      "fbc": "fb.1.1732399000123.CLICK_ID",
      "client_ip_address": "203.0.113.42",
      "client_user_agent": "Mozilla/5.0"
    }
  }]
}

Event Name

Purchase and purchase are two different events to Meta. So are AddToCart and Add To Cart. The safest way to avoid drift is to pass the event name from the browser call to the server call, so it’s only typed once.

External ID

The external ID is your own ID for the visitor: a user ID, a CRM contact ID or a first party session ID stored in a cookie. It needs to be captured server-side, or sent to the server event call as a parameter, so that the pixel session and the CAPI call point to the same person.

When an event ID is missing, Meta falls back to matching on the event name plus the external ID or fbp. It’s weaker than an event ID, and it only works when the browser event arrives first, but it really must be in place. It’s the only thing protecting you when an event ID gets dropped.

Naming the Event ID

  • Purchases: use the order ID. It’s unique, and both the confirmation page and the server already have it.
  • Everything else: use a UUID for events like Lead or PageView, one per event.

This is the critical piece most developers misunderstand: the UUID must be identical on the server side and the client side. If you call uuid() in the browser and again on the server, you get two different IDs and nothing is deduplicated. It has to be generated in one place and handed off to the other.

Send Server Events Through an API

For this reason I always advocate for tracking server events using an API approach. The browser generates the ID, fires the pixel, then posts the same ID and event name to a small tracking endpoint that forwards the event to Meta.

const eventId = crypto.randomUUID();

fbq('track', 'Lead', {}, { eventID: eventId });

fetch('/api/track', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    event_name: 'Lead',
    event_id: eventId,
    event_source_url: location.href
  })
});

This keeps CAPI calls out of an application’s core logic. Engineering maintains one endpoint, and marketers can control and track events on their own, separately from engineering teams and their release schedule. I covered how to build that endpoint in my server-side event tracking guide.

Batching & the 48 Hour Window

Meta only deduplicates events that arrive within 48 hours of each other. If the pixel fires at checkout and a batch job sends the server event 50 hours later, Meta counts a second purchase.

Any batching has to finish inside that window. In practice I send CAPI events immediately, and within an hour at the most. Anything slower delays reporting and hurts attribution accuracy, even when deduplication still works.

Match Quality Is Separate

Deduplication tells Meta that two events are the same event. Event Match Quality tells you how well Meta can connect a server event to a person. You can have perfect deduplication and a poor match score.

To raise it, send these in user_data with every server event:

  • fbp and fbc, read from the _fbp and _fbc cookies and sent as is, not hashed
  • client_ip_address and client_user_agent from the visitor’s request, not your server’s
  • external_id, the same value the pixel sends
  • em and ph when you have them, trimmed, lowercased and SHA-256 hashed

Events like PageView will always score lower than Lead or Purchase, because you rarely have an email address that early.

Common Pitfalls

Problem Cause Fix
Duplicate purchases The pixel and server each create their own ID, or a batch arrives after 48 hours Use the order ID on both sides and send right away
Browser events missing an event ID eventID is in the third argument, or spelled event_id or eventId Move it to the fourth argument with the exact casing
Same ID, still two events Event names don’t match Compare the names character by character
Counts don’t line up Mismatched triggers, like a “Buy” button click paired with a payment confirmation webhook Fire both from the same milestone. Failed payments and timing gaps will never match.
Double firing Two pixels on one domain, like a native Shopify integration next to a hardcoded pixel or GTM tag with no shared IDs One base pixel per domain

Never disable the pixel to “fix” double counting. With both active, CAPI captures the events that ad blockers and ITP block, and the pixel captures the browser context the server can’t see.

Verifying the Fix

  1. In Events Manager, open your dataset and go to Test Events.
  2. Trigger a test conversion on your site.
  3. Confirm that a browser row and a server row appear with identical event names and event IDs, and that one is marked Deduplicated.
  4. Over the next day or two, open the event from the dataset’s Overview tab and check its event deduplication details. You want a high percentage of browser and server events carrying an event ID, and a healthy overlap between the two.

The same pattern applies to almost every other ad network, which I cover in Server-Side Tracking Event Deduplication.