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

# Troubleshooting: Duplicate Events

> Fix duplicate events, inflated revenue, and doubled conversion counts in Upstack Data — covers client/server overlap, page reloads, Shopify thank-you page behavior, and deduplication settings.

## Quick Diagnostic

<Tip>
  **Start here:** Open the **Live Event Stream** in your Upstack dashboard and filter by `Purchase` events. If you see two events with identical timestamps and order IDs, you likely have both the Shopify native pixel and the Upstack server-side integration firing for the same conversion. Upstack deduplicates automatically when both events share the same `event_id` — the fix is usually ensuring consistent event IDs.
</Tip>

## Symptoms and Fixes

<AccordionGroup>
  <Accordion title="Symptom: Same purchase event appears twice with identical order details">
    **Likely cause:** Both a client-side pixel (e.g., Shopify's native conversion tracking or a custom script) and Upstack's server-side integration are capturing the same purchase event. Without matching `event_id` values, Upstack treats them as separate events.

    **Fix:**

    1. Go to **Live Event Stream** and click on the duplicate purchase events. Compare their `source` field:
       * If one shows `pixel` (client-side) and the other shows `webhook` or `server` — this confirms the overlap.
    2. **Recommended approach — rely on server-side only:** In your Shopify admin, go to **Settings → Customer events** and disable any custom purchase tracking scripts that duplicate what Upstack already captures via server-side webhooks.
    3. **Alternative — keep both with deduplication:** If you need client-side events for latency reasons, ensure both the client pixel and the Shopify webhook send the same `event_id` (the Shopify order ID works well). Upstack deduplicates events sharing the same `event_id` within a 5-minute window.
    4. After making changes, monitor the Live Event Stream for 30 minutes to confirm duplicates have stopped.
  </Accordion>

  <Accordion title="Symptom: PageView or AddToCart events are doubled on certain pages">
    **Likely cause:** A page reload or client-side navigation quirk is causing the Upstack pixel to fire twice. Common triggers include Shopify's AJAX cart updates (which some themes handle as full page reloads) and single-page app themes that fire both a `popstate` event and a full page load.

    **Fix:**

    1. Open your store in Chrome → DevTools → **Network** tab. Filter by `upstack` or your pixel endpoint.
    2. Navigate to the page where duplicates occur. Watch for two network requests firing for the same event.
    3. If you see two requests:
       * Check if your theme uses AJAX cart functionality — some themes trigger a full page reload after adding to cart, which fires `PageView` again.
       * Check if you have a custom Upstack initialization script in addition to the app embed — only one should be active.
    4. Go to **Online Store → Themes → Customize → App embeds** and ensure only the official **Upstack Data** embed is enabled. Remove any manual `<script>` tags referencing Upstack from your theme's `layout.liquid` or `theme.liquid` files.
    5. If you're using a headless or SPA Shopify theme, consult the [headless integration guide](/sources/shopify) — the pixel should track route changes via the History API, not full page reloads.
  </Accordion>

  <Accordion title="Symptom: Revenue numbers are exactly 2x what Shopify reports">
    **Likely cause:** Every purchase is being double-counted. This is a strong signal of the client/server overlap described in the first accordion. When both sources fire without deduplication, every dollar is counted twice.

    **Fix:**

    1. This is the same root cause as the first symptom above. Follow those steps first.
    2. As a quick verification, go to **Analytics → Attribution** and compare your total revenue for the last 7 days against Shopify's **Analytics → Reports → Total sales** for the same period. If Upstack is \~2x, duplicates are confirmed.
    3. After fixing the duplication source, note that historical data will still reflect the doubled numbers. Revenue will normalize going forward.
    4. If you need corrected historical data, contact support with the date range affected — we can flag the duplicate events.
  </Accordion>

  <Accordion title="Symptom: Shopify thank-you page triggers multiple Purchase events">
    **Likely cause:** The Shopify order confirmation (thank-you) page can be reloaded by the customer — by refreshing the page, clicking a bookmark, or returning via browser history. Each reload fires the client-side purchase event again if the pixel doesn't guard against repeat fires.

    **Fix:**

    1. Upstack's server-side integration is immune to this issue because it processes the Shopify `orders/paid` webhook, which fires exactly once per order.
    2. If you're relying on the client-side pixel for purchase tracking, the Upstack pixel includes built-in protection against thank-you page reloads — it stores the last order ID in session storage and skips duplicate fires.
    3. If duplicates persist, verify you're using the latest version of the Upstack app embed:
       * In Shopify admin → **Apps → Upstack Data**, check for any available updates.
       * If using a manual script, update to the latest version from your Upstack dashboard → **Settings → Pixel → Installation**.
    4. For maximum accuracy, we recommend relying on server-side `Purchase` tracking exclusively and using client-side events only for browsing behavior (`PageView`, `AddToCart`, `ViewContent`).
  </Accordion>
</AccordionGroup>

## Escalation

<Warning>
  If none of the above resolved the issue, collect the following before contacting support:

  * Your **Pixel ID** and the **event type** being duplicated
  * **Two or more event IDs** of duplicate events from the Live Event Stream
  * The **timestamp range** when duplicates occur
  * Your **Shopify theme name** and whether you use any custom tracking scripts
</Warning>

***

**Still stuck?** Contact [support@upstackdata.com](mailto:support@upstackdata.com) with your Pixel ID and a description of the issue. We typically respond within a few hours.

## Related guides

<CardGroup cols={2}>
  <Card title="Disable existing tracking" icon="ban" href="/get-started/disable-existing-tracking">
    Turn off redundant tracking pixels and integrations to prevent duplicate events.
  </Card>

  <Card title="Disable Facebook data sharing" icon="meta" href="/guides/facebook-ads/how-to-disable-facebook-and-instagram-data-sharing-in-shopify">
    Disable the Facebook and Instagram Sales Channel data sharing in Shopify.
  </Card>

  <Card title="Disable TikTok data sharing" icon="ban" href="/guides/tiktok-ads/how-to-disable-tiktok-data-sharing-in-shopify">
    Disable TikTok Sales Channel data sharing in Shopify to prevent duplicate conversions.
  </Card>
</CardGroup>
