Fix guide · Shopify · easy · about 20 min
Duplicate OpenAI Pixel events on Shopify
For the finding “Duplicate OpenAI events”. Also for: Any website, WordPress, Webflow, Framer.
What this means
The same event (for example page_viewed or order_created) was sent twice for the same OpenAI Pixel ID within about a second. On Shopify, this nearly always means the OpenAI Pixel (the ChatGPT Ads Measurement Pixel) is installed in two places. Shopify’s own help warns about this before you add a custom pixel: remove or modify existing pixels so that customer events are not counted twice.
OpenAI throws away exact repeats: it keeps the first event with the same Pixel ID, event name and event ID. But when a copy passes no event_id, the pixel gives each call its own random ID (OpenAI does not document this, but you can see it in the request payload), so two copies of one action look like two conversions.
Why it costs you money:
- ChatGPT Ads counts some conversions twice, so reports look better than reality and your cost per conversion looks lower than it is.
- Conversion-optimized campaigns learn from inflated data and may optimize toward the wrong results.
This is about two identical browser events. A browser event plus a server (Conversions API) event for the same order is expected; OpenAI counts that pair once when both carry the same event ID (see “OpenAI events have no event ID”).
How to confirm it yourself
Our check runs from a browser in the EU and accepts the cookie banner before looking for duplicates.
- Open your store in a private (incognito) window, open developer tools (F12), go to Network and filter by
bzr.openai.com. - Accept cookies.
- Click the requests and look at the payload: each request carries a list of
events, and the pixel batches events that happen close together, so one request can contain both copies. The Pixel ID is thepidvalue in the request address. Two events with the sametypefor the samepidat almost the same moment are a duplicate. Differentpidvalues mean two different pixels, which is a separate question. - Two requests for the same
pidcan also come from two copies of the SDK. In the Console tab,typeof oaiqreturns"function"when a copy runs on the page itself (theme code, an app embed or GTM loaded by the theme). Copies in custom pixels and app pixels run in Shopify’s sandboxes and do not show up there, so a"function"result plus a Customer events pixel for the same Pixel ID means two installations. - Repeat on a product page and after adding a product to the cart, with the events your setup sends (for example
contents_viewedanditems_added). To check purchases, place a test order with Shopify’s test payment gateway or Shopify Payments’ test mode and look fororder_created: it should appear once per Pixel ID.
How to fix
Keep exactly one installation per Pixel ID and remove the rest.
- List every place a Shopify store can load the pixel:
- Settings > Customer events: app pixels from ChatGPT Ads apps, and every custom pixel (look for
oaiqor your Pixel ID in its code). - Apps: every ChatGPT Ads app you installed, including one you tried earlier and replaced. OpenAI does not make a Shopify app; several third-party apps add the pixel, and some add the Conversions API too.
- Theme code: go to Online Store, open the menu of your current theme, click Edit code, open
theme.liquidand search foroaiq.min.jsandoaiq(. Check the snippets it includes too. - App embeds: Online Store > Edit theme > App embeds icon.
- Google Tag Manager: OpenAI’s own GTM template, Stape’s OpenAI Ads Pixel tag, and Custom HTML tags with
oaiq. GTM itself can also be installed twice (intheme.liquidand as a custom pixel); then every tag fires twice.
- Settings > Customer events: app pixels from ChatGPT Ads apps, and every custom pixel (look for
- Keep one installation. If an app sends both browser and Conversions API events, so that it can share event IDs between them, keep that app and remove the manual copies. If you manage everything yourself, keep one custom pixel (or GTM in one place). Then:
- delete the OpenAI snippet from
theme.liquidand click Save; - disconnect custom pixels that send events for the same Pixel ID (Disconnect keeps the code, so you can delete it later);
- uninstall apps you no longer use, or turn off their pixel in the app’s settings;
- remove OpenAI tags from GTM, and turn off app embeds that add another copy.
- delete the OpenAI snippet from
- Do not count on the snippet’s own check. OpenAI’s snippet skips loading when
oaiqalready exists. Shopify documents that a custom pixel runs in its own sandboxed frame and cannot reach the page, and that app pixels run in a web worker. So the check only sees its own frame: a copy in the theme and a copy in a custom pixel (or two custom pixels) each load the SDK and each send their own events. - Check purchase tracking separately. Theme code does not run on checkout pages, and Shopify has retired Additional scripts and script tags on the Thank you and Order status pages. Purchases are therefore tracked by app pixels or custom pixels, which Shopify loads on the storefront, checkout, Thank you and Order status pages. A custom pixel that sends
order_creatednext to an app that also sends it doubles every order. - Merge custom pixels that use the same Pixel ID (for example one named for checkout and one for the storefront). Each one loads on every storefront and checkout page, so each sends its events everywhere unless its code says otherwise.
- Check page views. Send
page_viewedfrom one place only. A custom pixel that subscribes to Shopify’spage_viewedevent and a theme copy that also callsoaiq("measure", "page_viewed", ...)send every page view twice. - Add event IDs as a safety net. In a custom pixel, pass Shopify’s event ID, or the order ID for purchases, as
event_id. An accidental second call with the same ID is then dropped by OpenAI. This does not replace removing the extra copy. - Save every change, and publish GTM if you changed it.
Common causes
- The snippet is still in
theme.liquidafter a ChatGPT Ads app or a custom pixel was set up. - Two ChatGPT Ads apps are installed, or an old one still runs its pixel.
- A custom pixel sends events for the same Pixel ID as an app.
- GTM runs twice, or two GTM tags send the same event.
- Two custom pixels with the same Pixel ID, each loading on every page.
How to verify the fix
- In a private window, accept cookies and check that each event appears once per Pixel ID: on page load, on a product page and after adding to cart.
- Place a test order and check that
order_createdleaves once. - Re-run the check on IsPixelWorking. The issue should be gone.
Questions people ask
Can I use two ChatGPT Ads apps at the same time?
Not for the same Pixel ID. Each app sends its own events, so every action is counted twice unless both use the same event IDs, which separate apps have no way to agree on. Pick one, and uninstall the other or switch off its pixel.
Sources
- OpenAI Developers, Measurement Pixel (installation snippet with its check for an existing
oaiq; batching of closely groupedmeasurecalls;event_id; OpenAI uses the first event for a matching key and ignores later duplicates): https://developers.openai.com/ads/measurement-pixel - OpenAI Developers, Multiple Pixel IDs (load the SDK once, initialize each Pixel ID): https://developers.openai.com/ads/multiple-pixels
- Stape, OpenAI Ads Pixel tag for web GTM (third-party template): https://stape.io/helpdesk/documentation/openai-ads-pixel-tag
- Shopify Help Center, Manage your custom pixels (remove or modify existing pixels so customer events aren’t counted twice; connect, disconnect, delete): https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage
- Shopify Help Center, Pixels overview (pixels load on the storefront, checkout, Thank you and Order status pages): https://help.shopify.com/en/manual/promoting-marketing/pixels/overview
- Shopify Help Center, App pixels: https://help.shopify.com/en/manual/promoting-marketing/pixels/app-pixels
- Shopify Help Center, Migrating pixels (remove old pixel code before connecting a new pixel to avoid duplicate tracking): https://help.shopify.com/en/manual/promoting-marketing/pixels/pixel-migration
- Shopify Help Center, Placing a test order (test payment gateway, Shopify Payments test mode): https://help.shopify.com/en/manual/checkout-settings/test-orders
- Shopify Help Center, Extend your theme with apps (app embeds): https://help.shopify.com/en/manual/online-store/themes/customizing-themes/apps
- Shopify.dev, About web pixels (app pixels run in a web worker; custom pixels run in a sandboxed frame that cannot access the top frame): https://shopify.dev/docs/apps/build/marketing/pixels
- Shopify.dev, Layouts (
theme.liquidapplies to non-checkout pages): https://shopify.dev/docs/storefronts/themes/architecture/layouts - Shopify.dev, checkout.liquid (checkout.liquid and additional scripts sunset for the Thank you and Order status pages; script tags sunset August 28, 2025 for Plus and August 26, 2026 for other stores): https://shopify.dev/docs/storefronts/themes/architecture/layouts/checkout-liquid
More OpenAI guides
- OpenAI Pixel fires before cookie consent on Shopify
- OpenAI Pixel not firing after cookie consent on Shopify
- Repeated OpenAI event IDs drop ChatGPT Ads conversions
- OpenAI Pixel events have no event ID on Shopify
- ChatGPT Ads click ID (oppref) lost on Shopify
- OpenAI Pixel tracks a button on desktop but not on mobile
- Two OpenAI Pixel IDs on one site: when it's fine, how to fix
- OpenAI Conversions API deduplication: match the pixel event_id
- OpenAI Ads Pixel setup: install the ChatGPT Measurement Pixel
- How to set up the OpenAI Conversions API for ChatGPT Ads