# Meta Pixel and Conversions API together: deduplication, event IDs and which events to send

> Run the Meta pixel and Conversions API side by side: matching event_id and eventID, the 48-hour window, match quality, and which events each should send.

Source: https://hoplytic.com/blog/meta-pixel-and-conversions-api · Updated 2026-11-29 · Hoplytic Guides

Video version (77 seconds): [https://hoplytic.com/video/meta-pixel-and-conversions-api.mp4](https://hoplytic.com/video/meta-pixel-and-conversions-api.mp4)

## Video transcript

How do you run the Meta pixel and the Conversions API together without counting everything twice?

Meta keeps one copy only when the event ID matches, the event name matches, both go to the same pixel, and the second arrives within forty-eight hours.

Generate the ID once and hand it to both. Two separately made I Ds never match.

Events on your own pages can go through the pixel and the server. On the merchant's site, you can't place a pixel at all. So an affiliate sale comes from the server alone, after the network reports it. Use the network's transaction ID as event ID, so a retry isn't counted twice.

And never fire a Purchase from the pixel when someone clicks your affiliate link. Meta would optimise for clicks dressed up as sales.

Open Test events in Events Manager, and submit once. You should see the browser and server copies with identical event I Ds. With an ad blocker on, only the server copy arrives.

Hoplytic handles the server-only half, the sale on the merchant's site. It sends the network's transaction ID as event ID, so a resent or approved sale isn't counted twice. It doesn't fire or replace your pixel.

The full guide is right below. Hoplytic: ad tracking made simple.

## Key points

- Meta drops a duplicate only when the pixel's eventID matches the server's event_id, the event names match, both go to the same pixel, and they arrive within 48 hours.
- Generate the event ID once, in the browser or on your server, and hand the same value to both sides; two separately generated IDs never match.
- Deduplication only matters for events you send twice. An affiliate sale on a merchant's site can only come from the server, so it needs an event_id for retries, not for pixel matching.
- Low event match quality on affiliate events is normal because you never see the buyer's email; a correct fbc on every event matters more than the score.
- Never fire a Purchase from the pixel when a visitor clicks your affiliate link: Meta would optimize for clicks dressed up as sales.

Running the Meta pixel and the Conversions API together is the setup Meta recommends: the browser sends what it can, the server fills the gaps. Done right, each action counts once. Done wrong, Ads Manager shows twice the leads you really got, and the bidding chases numbers that don't exist.

**Short answer:** send the same action from the pixel and from your server with one shared ID: `eventID` in the pixel call, `event_id` in the server event, plus the same event name and pixel ID. Meta keeps one copy if the second arrives within 48 hours. Events that only happen off your site, like an affiliate sale, come from the server alone and need no pixel match.

This guide is about running both routes at once. For building the server event itself (the `fbc` value, the 7-day limit, test codes), see [Meta Conversions API for affiliates](https://hoplytic.com/blog/meta-conversions-api-affiliate).

## Why run the Meta pixel and Conversions API together

The pixel runs in the visitor's browser. It sees the page, reads Meta's `_fbp` and `_fbc` cookies and fires the moment something happens. It also misses events: ad blockers, browser tracking protection, slow pages and closed tabs all stop it. The Conversions API runs on a server. It doesn't care about blockers, but it only knows what you tell it, and it can't see the cookies unless you pass them along.

Sending the same action both ways covers the losses of each. The price is that Meta now receives most actions twice, and it needs a way to tell they are the same one.

## The deduplication rules

Meta's documentation recommends deduplicating on the event ID and event name. An event counts as a duplicate when all of these hold:

| Check | Pixel (browser) | Conversions API (server) |
| --- | --- | --- |
| Same ID | `eventID` option on `fbq('track', ...)`, or `eid` on the image pixel | `event_id` |
| Same name | The event, for example `Lead` | `event_name`, for example `Lead` |
| Same destination | Pixel ID in the base code | Pixel (dataset) ID in the endpoint |
| Time | The second copy arrives within 48 hours of the first one with that ID |

The ID is case sensitive and must be identical: `lead-5c21e0` and `Lead-5c21e0` are two events. A `Lead` and a `CompleteRegistration` with the same ID are also two events, because the names differ.

Meta also describes a fallback that matches on `fbp` or `external_id`. Its own documentation lists the limits: it only works when the browser event arrives before the server one, and it never removes duplicates that come from the same source. Treat it as a safety net, not the plan.

## Generating one event ID for both sides

The most common bug is two IDs: the page makes one for the pixel and the server makes another. They never match, so every action is counted twice. Make the ID once and pass it on.

On a page where the visitor submits a form, for example an email opt-in on your presell page:

`<form id="optin" action="/subscribe" method="post">
<input type="email" name="email" required>
<input type="hidden" name="event_id" id="event_id">
<button>Send me the guide</button>
</form>
<script>
document.getElementById('optin').addEventListener('submit', function () {
var id = 'lead-' + Date.now().toString(36) + Math.random().toString(36).slice(2, 8);
document.getElementById('event_id').value = id;
fbq('track', 'Lead', {}, { eventID: id });
});
</script>`
Your `/subscribe` handler then sends a `Lead` server event with `"event_id"` set to the value from the hidden field. If the visitor's browser blocked the pixel, the server copy still arrives. If both arrive, Meta keeps one.

When the action happens on your server first, such as an order in your own store, do it the other way round: the server creates the ID (the order number is ideal), prints it into the thank-you page, and the pixel uses it.

## Which events go where, for affiliates

Most affiliate funnels split cleanly. What happens on your pages can go both ways. What happens on the merchant's site can only go one way.

| Event | Where it happens | Pixel | Server | Dedup needed |
| --- | --- | --- | --- | --- |
| `PageView`, `ViewContent` | Your landing or review page | Yes | Optional | Only if you send both |
| `Lead` (your own opt-in) | Your page | Yes | Yes | Yes |
| Click on the affiliate link | Your page | A custom event at most | Optional | Only if you send both |
| `Purchase` or `Lead` on the offer | Merchant's site | Impossible: you can't place code there | Yes, once the network reports it | No pixel match; use event_id against retries |

The sale row is the one people get wrong. Some setups fire `Purchase` from the pixel when a visitor clicks "Check price", because it is the last thing the page can see. Meta then optimizes for people who click, not people who buy, and your reported return on ad spend becomes fiction. If you want click data in Meta, use a clearly named custom event and keep your campaign optimizing for the real sale sent from the server.

For the server-only sale, `event_id` still matters. Use the network's order or transaction ID, for example `ORD-88412`. If your server times out and retries, or the network reports the sale again when it is approved, the second send is dropped instead of counted. The broader problem of counting sales twice is covered in [duplicate conversions](https://hoplytic.com/blog/duplicate-conversions).

## Match quality when you run both

Events Manager gives web events an event match quality score out of 10, based on the customer information attached. Meta lists email, phone, IP address, user agent, `fbp` and `fbc` among the most useful keys, and requires `client_user_agent` on website server events.

For events on your own pages, the easy win is to read the `_fbp` and `_fbc` cookies in the browser and send them with the server copy. That gives the server event the same identity the pixel had. If the visitor entered an email on your form, you can also send it, hashed as Meta's documentation describes, if your privacy notice and consent cover it.

For affiliate sales you rarely have any of that. You have the [fbclid](https://hoplytic.com/blog/glossary/fbclid) from the ad click, turned into `fbc`, and the browser's user agent. The score will look low next to a store's. That is expected. An `fbc` that points at the exact click is worth more than a guessed field, and you should never invent personal data to lift the number.

## Checking that it works

- Open Test events in Events Manager and load your page with the test code active.

- Submit the form once. You should see the `Lead` arrive from the browser and from the server.

- Open each event's details and compare the event ID. They must be identical.

- Over the next days, compare Meta's `Lead` count with the leads in your own database. If Meta's number is close to double, the IDs don't match or the names differ.

- Block the pixel with an ad blocker and submit again. Only the server copy should arrive, and it should still count.

## Where Hoplytic fits

Hoplytic handles the server-only half: the sale on the merchant's site. Its [Send back](https://hoplytic.com/help/send-sales-to-ad-platforms) feature sends each sale the network reports to the Conversions API with `fbc` built from the stored fbclid and the network's transaction ID as `event_id`, so a resent or approved sale isn't counted twice. It doesn't fire or replace your pixel, and it doesn't send your on-page events like an opt-in `Lead`: keep those in your own pixel and server code, deduplicated as above. If visitors land on your page before clicking out, the [site script](https://hoplytic.com/help/site-script) carries the fbclid from the landing page to the click, so the sale can still be matched to the ad.

![Setting up Send back in Hoplytic: choose the ad platform, follow the steps shown for it, pick when each sale is sent and what value is reported.](https://hoplytic.com/video/howto-send-back.gif)

*Choose the ad platform, then when to send each sale and its value.*

## Questions people ask

### Do I need both the Meta pixel and the Conversions API?

Meta recommends sending events through both, so a browser event lost to an ad blocker or closed tab can still arrive from the server. For events that happen on a merchant's site, such as an affiliate sale, only the server route is possible.

### How does Meta deduplicate pixel and server events?

It compares the pixel's eventID and event name with the server event's event_id and event_name sent to the same pixel. If both match and the second arrives within 48 hours of the first, Meta keeps one.

### What happens if I send the same event without an event ID?

Meta can try to match on fbp or external_id, but that only works when the browser event arrives first, and it never removes duplicates sent from the same source. In practice you usually see the event counted twice.

### Can the Conversions API get around cookie consent?

No. Server events are a different delivery route, not a different legal basis. If your visitors need to consent before you send their data to Meta, that applies to both routes.
