Fix guide · Framer · easy · about 20 min

Duplicate OpenAI Pixel events on Framer: how to fix

For the finding “Duplicate OpenAI events”. Also for: Any website, Shopify, WordPress, Webflow.

What this means

The same event (for example page_viewed or lead_created) was sent twice for the same OpenAI Pixel ID within about a second. On Framer, this nearly always means the pixel or one of its event calls is installed in two places, or a script runs more often than intended.

OpenAI does throw away exact repeats: it keeps the first event with the same Pixel ID, event name and event ID. But when your code 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 calls for one action look like two different 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 and a server (Conversions API) event for the same action are 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.

  1. Open your published site in a private (incognito) window, open developer tools (F12), go to Network and filter by bzr.openai.com.
  2. Accept cookies.
  3. Click the requests and look at the payload: each carries a list of events, and the pixel batches events that happen close together, so one request can hold both copies. The Pixel ID is the pid value in the request address. Two events with the same type for the same pid at almost the same moment are a duplicate. Two different pid values are two pixels, which is a separate finding (“More than one OpenAI Pixel”).
  4. Click through to another page and submit a test form. Each page change and each submission should produce one event per Pixel ID, not two.
  5. If your OpenAI tags are in Google Tag Manager (GTM), open Preview mode and look for two OpenAI tags firing on the same event.

How to fix

  1. Check every place a Framer site can send OpenAI events. Search the published page source for oaiq.min.js and oaiq(, then go through:
    • Site Settings > Code (some Framer help pages call it Project Settings > Custom Code). Each entry is a separate script with its own Placement, Pages and Run settings, so open every entry, including ones limited to selected pages.
    • Page-level custom code in each page’s settings. A page can carry a copy on top of the site-wide one.
    • Embeds, code components, code overrides and marketplace components on the canvas.
    • Plugins or third-party tools that install the OpenAI pixel for you.
    • Your GTM container: Custom HTML tags containing oaiq, OpenAI’s template (OpenAI Ads Measurement Pixel) and Stape’s OpenAI Ads Pixel tag.
  2. Check that GTM is installed only once. Framer’s Cookie Banner loads GTM itself when its GTM ID property is filled in. If a GTM snippet is also pasted into custom code, remove the snippet; the container should not load twice. If the Network tab shows gtm.js requests for two different container IDs, check both: if each holds an OpenAI tag, every event goes out twice.
  3. Keep one installation, remove the rest. If you use Framer’s Cookie Banner, keep the GTM copy (it is the one that waits for consent) and remove the pixel from custom code and embeds. OpenAI’s snippet checks whether oaiq already exists, so a second copy usually does not load the SDK twice, but its own init and measure calls still run. Remove the whole entry, not just the <script> line.
  4. Check how often your scripts run. Framer changes pages without a full page reload. Each custom code entry’s Run setting decides whether it runs Once or on every page visit:
    • Framer recommends Once for code that adds event listeners, such as a script that listens for Framer’s framer:formsubmit event and sends lead_created. Set listener scripts to Once, then test: click through a few pages, submit the form once, and count the lead_created events.
    • Only one thing should send page_viewed for each page change. For example, not both a custom code entry that calls oaiq("measure", "page_viewed", ...) on every page visit and a GTM tag on a History Change trigger.
    • In GTM, a page_viewed tag with both a cookie_consent_update trigger and an Initialization trigger should fire Once per page.
  5. Check event calls as well as the base code. Framer forms can redirect on submit to a thank-you page. If one tag sends lead_created when the form is submitted and another sends it when the thank-you page loads, keep one.
  6. Add event IDs. With your own event_id on each action, an accidental second call for the same action carries the same ID, and OpenAI keeps only the first. That is a safety net, not a replacement for removing the extra copy. See OpenAI events have no event ID.
  7. Publish the Framer site, and the GTM container if you changed it.

Common causes

  • The snippet is in Site Settings > Code and in a GTM tag.
  • The GTM container is loaded by the Cookie Banner and again by a snippet in custom code.
  • A site-wide custom code entry and a page-level entry both hold the pixel on the same page.
  • A form or page view script is set to run on every page visit while another tag sends the same event.
  • lead_created is sent on form submission and again on the thank-you page.
  • A template or marketplace component came with a pixel already embedded.

How to verify the fix

  1. In a private window on the published site, accept cookies and check that each event appears once per Pixel ID: on page load, after moving through a few pages, and after a test form submission.
  2. Re-run the check on IsPixelWorking. The issue should be gone.

Sources

More OpenAI guides