Step-by-Step Guide: Implementing OpenAI Ads Conversion Tracking (Beta) via GTM

Quick Summary (TL;DR):

Master client-side OpenAI Ads conversion tracking (Beta) using Google Tag Manager. Learn step-by-step pixel setup, custom JavaScript event mapping for AJAX/iFrame forms, Calendly booking integration, and how to implement a JavaScript guard to prevent iOS Safari duplicate conversion fires.

OpenAI is rolling out its native advertising infrastructure, introducing conversion tracking pixels (currently in Beta) for advertisers looking to attribute lead generation and user actions across AI-driven discovery channels.

While setting up a basic pixel appears simple, tracking real-world conversions across dynamic web environments introduces complex technical hurdles. Between AJAX form submits, iFrame security restrictions, dynamic page views, and iOS Safari reload bugs, standard client-side tags often fire duplicate conversions or miss events entirely.

Here is the complete step-by-step guide to installing and bulletproofing the OpenAI Ads Pixel using Google Tag Manager (GTM).

Step 1: Generate & Name Your OpenAI Pixel

  1. Log in to your OpenAI Ads Dashboard.

  2. In the top right corner, click on the profile/settings dropdown and select Data Source.

  3. Click to create a new pixel source, assign a distinct name (e.g., OpenAI_Main_Web_Pixel), and copy the base initialization code snippet provided.


openAI Ads Pixel



openAI Ads Pixel Name

Step 2: Base Pixel Installation via GTM

To ensure the OpenAI pixel script executes before standard page triggers, deploy the base snippet in GTM using a Custom HTML tag configured with an Initialization trigger.

  1. Open your GTM container and navigate to Tags ➔ New.

  2. Select Custom HTML as the tag type.

  3. Paste the OpenAI base pixel initialization code.

  4. Set the trigger to Initialization - All Pages.


openAI ads pixel config gtm



Step 3: Define & Map Conversion Goals in OpenAI

Return to the OpenAI Ads dashboard under Data Sources:

  1. Open the conversion mapping interface and select your newly created pixel.

  2. Define your conversion events (e.g., Lead Created, Page View, or Custom Conversion).

  3. OpenAI provides two implementation options: a pre-built GTM template or a custom JavaScript snippet.

Pro Tip: Using the Custom JavaScript Snippet approach grants total control over triggering rules, allowing you to intercept complex AJAX callbacks and CRM listeners before firing the conversion.



openAI ads conversion event name


Step 4: Managing Complex Forms (AJAX, iFrames & iOS Safari Guards)

Most modern lead generation websites rely on third-party form builders, CRMs, or web platforms:

  • WordPress Builders: Fluent Forms, Contact Form 7, Ninja Forms, WPForms

  • Embedded Form Builders: Tally, Typeform, Paperform

  • CRMs: HubSpot, Pipedrive, Zoho, GoHighLevel

  • E-Commerce & Builders: Webflow, Wix, Shopify, Squarespace


openAI ads conversion event code


Because many of these forms rely on AJAX submissions or embedded iFrames, standard pageview triggers fail to detect conversions. Furthermore, iOS Safari’s aggressive page-reload behavior frequently re-triggers conversion tags on thank-you redirects, causing inflated conversion numbers.




Page View Event: Create a new GTM custom HTML tag with this code and trigger it on all pages.

Lead Create Event



Step 5: Tracking Calendly Booking Leads

If your funnel uses Calendly for consultation calls, do not rely on standard URL triggers (as embedded scheduling widgets run inside cross-domain iFrames).

Set up a dedicated Custom HTML tag listening for Calendly postMessage events:

<script> window.addEventListener('message', function(e) { if (e.data.event && e.data.event === 'calendly.event_scheduled') { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'openai_calendly_booked' }); } }); </script>

Map a Custom Event trigger in GTM for openai_calendly_booked to fire your OpenAI Calendly conversion tag safely.

OpenAI Ads conversion tracking setup workflow in Google Tag Manager by ArifulWebWise


Step 6: Custom Event Tracking for Key Landing Pages

Beyond standard leads, you can track high-intent behavioral actions—such as users visiting a high-tier pricing page or engaging with specific interactive elements.

Create a Custom Event tag in GTM to pass custom parameters to OpenAI Ads:




FAQ(Frequently Asked Questions)


Why should I use Custom HTML tags over standard templates for OpenAI Ads tracking?

Custom HTML tags allow analytics specialists to inject custom JavaScript guards (such as sessionStorage deduplication) and complex event listeners required for AJAX forms and Calendly postMessages that static templates cannot handle.


How do I prevent Safari on iOS from firing duplicate conversions on page reloads? By setting a sessionStorage key when the conversion first fires. When a user reloads the thank-you page on iOS Safari, the script checks the sessionStorage flag; if present, it suppresses the duplicate OpenAI tracking call.


Can OpenAI Ads tracking be implemented server-side (sGTM)? While OpenAI Ads pixel currently focuses on client-side deployment in its Beta stage, server-side integration via Server-Side GTM (sGTM) is expected as the platform matures, providing higher data resilience against ad-blockers and ITP restrictions.