Skip to main content
The Order ID is a unique identifier for a transaction (like a purchase or payment). Cometly uses it to prevent duplicate events and keep revenue tracking accurate. An event is an action Cometly records for a customer, such as a purchase or a lead. Payment platforms and CRMs often send the same transaction more than once, for example when a webhook is retried. Order ID deduplication makes sure each sale counts once, so the revenue and conversions you see for each ad are real. You set the Order ID wherever you send event data to Cometly, through a webhook, an integration or the API.

Why this matters

If you send duplicate events without proper deduplication, your revenue and conversions are inflated. Using Order ID correctly gives you:
  • Clean reporting
  • Accurate attribution
  • No duplicate purchases or payments

What is Order ID?

The Order ID is the unique ID your platform assigns to a transaction. When you send events with an Order ID, Cometly uses it to decide whether the event is new or a duplicate.

Where you set it

  • Webhook and integration events: in the event’s mapping step, map your data to the Cometly field Order Id. The related fields Order Name and Idempotency Key are mapped the same way.
  • API events: send order_id (and optionally order_name or idempotency_key) in the request body. See Create Event.

How Order ID deduplication works

When an event is received, Cometly checks: “Have I already seen this event name + Order ID for this customer?”
  • If yes: the event is treated as a duplicate. It is ignored completely and no updates are made.
  • If no: the event is recorded normally.
Two behaviors to keep in mind:
  • First in wins. The first event received is the one that counts. Later duplicates are dropped.
  • No updates happen. Amounts, fields and properties are NOT updated. The original record stays unchanged.

Shopify exception (upsells)

There is one exception, and it applies only to the direct Shopify integration (not to webhooks you set up in your Shopify store):
  • If a duplicate purchase event comes in with a higher amount,
  • Cometly updates the original event amount.
This handles post-purchase upsells automatically. No extra setup is required.

Deduplication priority order

If multiple identifiers are present, Cometly uses this priority:
Deduplication only works within the same event type. Order ID does NOT deduplicate across different event names.

Example

If you send:
  • Purchase with Order ID ABC123
  • ClosedWon with Order ID ABC123
  • Upsell with Order ID ABC123
These are treated as 3 separate conversions, even though the Order ID is the same.

What this means

If your integration sends multiple event types for the same transaction:
  • Revenue is counted multiple times
  • Conversions are inflated

Common use cases

Use case 1: Simple purchase tracking

  • Send one Purchase event per transaction
  • Include the Order ID
Result: duplicate webhooks are ignored, and revenue stays clean and accurate.

Use case 2: Track total order value (booked revenue)

  • Send Purchase with the full order amount
Best for:
  • Ecommerce
  • Tracking total order value at checkout
Do NOT also send ClosedWon or Upsell, unless you want separate metrics.

Use case 3: Track revenue from deals (sales teams)

  • Send ClosedWon when a deal is finalized
Best for:
  • B2B and sales-led companies
  • CRM-based pipelines
Do NOT also send Purchase, unless you intentionally want sales pipeline revenue AND purchase revenue tracked separately.

Use case 4: Track additional revenue (upsells)

  • Send Upsell events when additional revenue is added after the initial purchase
Best for:
  • Post-purchase offers
  • Add-ons or upgrades
This is a separate event type, not a duplicate. It counts as additional revenue.

Use case 5: Force separate events (advanced)

If you need multiple events with the same Order ID to be treated as separate:
  • Add different Idempotency Keys
Result: the events are treated as separate transactions.
Pick one primary event type per business metric:
  • Want ecommerce revenue: use Purchase
  • Want sales pipeline revenue: use ClosedWon
  • Want add-ons: use Upsell
Do not mix event types for the same transaction unless you intentionally want multiple conversion records.

The key takeaway

  • Order ID prevents duplicates within the same event type
  • The first event wins, duplicates are ignored
  • Different event names = separate conversions
  • Choose your event strategy carefully to avoid inflated data

Frequently asked questions

Is Order ID required when I send events to Cometly?

No, Order ID is optional. Without it, Cometly falls back to the Order Name, and then to a time window (1 day for purchases, 1 week for other events). Send an Order ID with every transaction event, so duplicates are matched on the transaction itself and not on timing.

How do I remove a duplicate conversion that Cometly already recorded?

Delete it from the contact’s Timeline: open the contact, click the three-dot menu next to the conversion and click Delete. Deleting cannot be undone. See Edit or delete a conversion on a contact, and add an Order ID at the source so the duplicate does not come back.

Can I use the Meta pixel event ID as the Idempotency Key?

Yes. You can take the event_id from the Meta browser pixel and send it as the idempotency_key on an API event. When that conversion is attributed to a Meta ad, Cometly sends the same value to Meta as event_id, so Meta can deduplicate it against the browser event.

Next steps

Still have questions or need a hand? We’re happy to help. Reach our team at support@cometly.com.