> ## Documentation Index
> Fetch the complete documentation index at: https://oneviewhub.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deduplication

> Block duplicated conversions across platforms, using a unique event ID.

<Check>
  OneView automatically prevents duplicate events from being processed using idempotency keys. No configuration required.
</Check>

## What is Deduplication?

**Deduplication** prevents the same event from being processed multiple times, ensuring each conversion is counted exactly once in your workspace and sent to advertising platforms only once.

<Info>
  **Understanding deduplication vs. merit-based routing:**

  * **Deduplication**: Prevents the same event from being processed multiple times (e.g., page refresh fires the same event twice)
  * **Merit-based routing**: Prevents the same conversion from being sent to multiple platforms (e.g., both Google and Meta claim the same purchase)

  Both work together to ensure accurate conversion tracking.
</Info>

## How Deduplication works

OneView uses **idempotency keys** to identify and block duplicate events. When you send an event with the same idempotency key within the deduplication window (**14 months**), OneView processes it only once.

| Scenario                      | First Event         | Duplicate Event | Result              |
| ----------------------------- | ------------------- | --------------- | ------------------- |
| **Same idempotency key**      | Processed           | Blocked         | Event counted once  |
| **Different idempotency key** | Processed           | Processed       | Both events counted |
| **Key outside window**        | Processed (expired) | Processed       | Both events counted |

<Check>
  Idempotency keys are valid for **14 months**. After this period, the same key can be reused for a new event.
</Check>

## When duplicates occur

Event duplication happens when the same user action triggers multiple tracking calls:

| Cause                        | Example                              | Impact                          |
| ---------------------------- | ------------------------------------ | ------------------------------- |
| **Page refreshes**           | User refreshes thank-you page        | Same purchase event sent twice  |
| **Back-button navigation**   | User navigates back, then forward    | Event fires again               |
| **Multiple implementations** | Both GTM Web and backend send event  | Duplicate tracking calls        |
| **Single-page apps**         | Route changes trigger multiple times | Same event fired multiple times |

<Warning>
  Without deduplication, a single purchase might be counted multiple times, inflating your conversion numbers and causing platforms to optimize on incorrect data.
</Warning>

## Idempotency keys

An **idempotency key** is a unique identifier that ensures the same request produces the same result, preventing duplicate processing.

<Info>
  **Best practices for idempotency keys:**

  Use a combination of identifiers that uniquely identify the event:

  * **E-commerce**: `user_id + order_id + event_type`
  * **Lead forms**: `user_id + form_id + timestamp`
  * **Page views**: `client_id + page_url + timestamp`

  The key should be deterministic—the same event should always generate the same key.
</Info>

## Deduplication window

OneView maintains idempotency keys for **14 months** to prevent duplicates across extended customer journeys.

| Timeframe            | Behavior                         |
| -------------------- | -------------------------------- |
| **Within 14 months** | Same key blocks duplicate events |
| **After 14 months**  | Key expires, can be reused       |

<Note>
  The 14-month window covers most customer journeys, including long B2B sales cycles and repeat purchases. If you need a longer window, contact support.
</Note>

## Common questions

<AccordionGroup>
  <Accordion title="How do I implement idempotency keys with OneView?">
    Include an `Idempotency-Key` header or field with each event request using a unique identifier. For example:

    * **E-commerce**: `user_id + order_id + event_type`
    * **Lead forms**: `user_id + form_id + timestamp`
    * **Page views**: `client_id + page_url + timestamp`

    OneView automatically uses this key to prevent duplicate processing.
  </Accordion>

  <Accordion title="What happens if I don't send an idempotency key?">
    OneView generates a deterministic idempotency key based on your event payload. However, explicitly providing an idempotency key gives you more control and ensures consistent deduplication across different implementations.
  </Accordion>

  <Accordion title="How does deduplication work with merit-based routing?">
    Deduplication and merit-based routing work together:

    1. **Deduplication** ensures the same event isn't processed multiple times in OneView
    2. **Merit-based routing** ensures the conversion is sent only to the platform that wins attribution

    Both are automatic and require no configuration.
  </Accordion>

  <Accordion title="Can I see which events were deduplicated?">
    Everything happens automatically in your workspace, and you will only see the final result in your reports.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Merit-Based Routing" icon="ranking-star" href="/docs/platform/features/processing/merit-based-routing">
    Learn how OneView routes conversions to their attributed sources.
  </Card>

  <Card title="Conversions" icon="bullseye-arrow" href="/docs/platform/concepts/conversions">
    Understand how OneView processes conversions across platforms.
  </Card>
</CardGroup>
