# Deduplicate with event_id

> Give an event an `event_id` and Baker counts it once, however many times it arrives: a retry, a replayed backfill or two requests racing. Use an id that comes from your own record, such as `deal-48213-won`, never a random one per attempt. The same id sent from the browser as `window.baker.track(name, { eventId })` makes the two one event.

Source: https://withbaker.com/docs/deduplication · Updated 2026-11-23

## How deduplication works

`event_id` is optional and means one thing: deduplicate me. Send the same id twice and it is one event, one conversion, its value added once. Send none and every post is its own event. A repeat is accepted like any other event, so there is nothing to branch on: in Baker both arrivals are listed, and the later one is marked **Already counted**.

## Choose a stable event id

- **Derive it from your own record and the stage**: `deal-48213-won`, `order-100482`, `order-100482-refund-1`. A deal that is won, reopened and won again is two ids only if you want two wins.
- **Never generate it per attempt.** A fresh UUID on each retry defeats the purpose: each retry is a new event.
- **1 to 128 characters** of letters, digits and `. _ : -`. An empty string is the same as sending none: nothing is deduplicated.
- **Twice in one batch counts once too**: the rule holds wherever the copies arrive.
- **Refunds need their own id**: use the refund's id from your system (`order-100482-refund-r_88`). With none, number them in order, `order-100482-refund-1`, `-2`: reusing one id for two partial refunds counts only the first.

## Browser and server, counted once

An important outcome is worth reporting from both sides: a browser can be blocked by an ad blocker, a server cannot. Pass one string as `event_id` here and as `eventId` in Baker's pixel, and the two are one event, whichever arrives first and whether or not the other ever does.

**Browser**

```js
// On the thank-you page, with Baker's pixel installed
window.baker.track("purchase", { eventId: "order-100482" });
```

**Server**

```json
{
  "events": [
    {
      "event_name": "purchase",
      "event_id": "order-100482",
      "user_data": {
        "email": "laura@example.com"
      },
      "value": "89.90",
      "currency": "EUR"
    }
  ]
}
```

> **Heads-up:** Without a shared id, the browser event and the server event are two conversions, and nothing anywhere reports an error.

## Need help?

Write to support@withbaker.com: a person answers within 24 hours. The OpenAPI description is at https://withbaker.com/docs/openapi.json.
