Skip to main content

How Order ID Works and When to Use It

Understand how Order ID controls deduplication in Cometly so you don’t double-count revenue or inflate conversions.

Updated this week

The Order ID is a unique identifier for a transaction (like a purchase or payment). Cometly uses it to prevent duplicate events and ensure accurate revenue tracking.

Why This Matters

If you send duplicate events without proper deduplication, your revenue and conversions will be inflated.

Using Order ID correctly ensures:

  • Clean reporting

  • Accurate attribution

  • No duplicate purchases or payments

What Is Order ID?

The Order ID is the unique ID assigned to a transaction by your platform.

Examples:

  • Shopify → Order ID

  • Stripe → Charge ID

  • CRM / Checkout → Internal order or transaction ID

When you send events with an Order ID, Cometly uses it to identify whether the event is new or a duplicate.


How 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

  • No updates are made

If NO:

  • The event is recorded normally

Important Behavior

  • First-in wins

    • The first event received is the one that counts

    • Later duplicates are dropped

  • No updates happen

    • Amounts, fields, or properties are NOT updated

    • The original record stays unchanged

Shopify Exception (Upsells)

There is one exception for the direct Shopify integration, (this does not apply if you are using Webhooks in your Shopify store) this applies only to the direct Shopify integration:

  • If a duplicate purchase event comes in with a higher amount

  • Cometly will update 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:

1. Idempotency Key (Highest Priority)

  • Same key → duplicate

  • Different key → treated as separate events (even with same Order ID)

  • Use this when you need full control

2. Order ID

  • Same Order ID + Event Name → duplicate

  • This is the default and most common method

3. Order Name

  • Used as a fallback (e.g. #1042)

  • Only applies if Order ID is not present

4. Time Window (Lowest Priority)

Used only if no identifiers exist:

  • Purchases → 1-day window

  • Other events → 1-week window

⚠️ Important:

Deduplication Only Works Within the Same Event Type. Order ID does NOT deduplicate across different event names.

Example

If you send:

  • Purchase → Order ID: ABC123

  • ClosedWon → Order ID: ABC123

  • Upsell → 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 will be counted multiple times

  • Conversions will be inflated



Common Use Cases

Use Case 1: Simple Purchase Tracking

  • Send one Purchase event per transaction

  • Include Order ID

✅ Result:

  • Duplicate webhooks are ignored

  • Clean and accurate revenue



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

  • 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 / 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

⚠️ Important:

  • This is a separate event type, not a duplicate

  • It will count 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:

  • Events are treated as separate transactions



💡 Pro Tip

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

  • First event wins, duplicates are ignored

  • Different event names = separate conversions

  • Choose your event strategy carefully to avoid inflated data

Did this answer your question?