> ## 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.

# PageView or AddToCart events are doubled on certain pages

> PageView or AddToCart events doubled on specific pages? A page reload or SPA navigation quirk is firing the pixel twice. Check for duplicate Upstack scripts and AJAX cart reload behavior.

**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 [Shopify integration guide](/sources/catalog/shopify) — the pixel should track route changes via the History API, not full page reloads.

***

**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.
