---
title: "How to install the ChatGPT Ads pixel with Google Tag Manager"
description: "Two ways to install the OpenAI pixel in Google Tag Manager: the official template or custom HTML tags. Consent, triggers and validation."
url: "https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager/"
markdown_url: "https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager.md"
lang: "en"
date_published: "2026-12-03"
author: "Martín Garay"
author_url: "https://cookingmetrics.com/about-martin-garay/"
publisher: "CookingMetrics"
publisher_url: "https://cookingmetrics.com/"
keywords: ["ChatGPT Ads", "ChatGPT", "Google Tag Manager", "MarTech"]
citation_apa7: "Garay, M. (2026, December 3). *How to install the ChatGPT Ads pixel with Google Tag Manager*. CookingMetrics. https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager/"
references_apa7:
  - "OpenAI Developers. (n.d.). *Measurement Pixel*. https://developers.openai.com/ads/measurement-pixel"
  - "OpenAI Developers. (n.d.). *Supported Events*. https://developers.openai.com/ads/supported-events"
  - "OpenAI Developers. (n.d.). *Configure more than one Pixel ID*. https://developers.openai.com/ads/multiple-pixels"
  - "OpenAI. (n.d.). *OpenAI Ads Measurement Pixel GTM Template*. https://github.com/openai/ads-measurement-pixel-gtm-template"
  - "Ayuda de Google Tag Manager. (n.d.). *Compatibilidad con el modo de consentimiento de Tag Manager*. https://support.google.com/tagmanager/answer/10718549?hl=es"
---

# How to install the ChatGPT Ads pixel with Google Tag Manager

> Two ways to install the OpenAI pixel in Google Tag Manager: the official template or custom HTML tags. Consent, triggers and validation.

- **Author:** [Martín Garay](https://cookingmetrics.com/about-martin-garay/) · Founder of CookingMetrics
- **Published:** December 3, 2026
- **Topics:** ChatGPT Ads, ChatGPT, Google Tag Manager, MarTech
- **Web version:** https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager/

## How to cite this article (APA, 7th edition)

Garay, M. (2026, December 3). *How to install the ChatGPT Ads pixel with Google Tag Manager*. CookingMetrics. https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager/

In-text citation: (Garay, 2026)

## References

- OpenAI Developers. (n.d.). *Measurement Pixel*. https://developers.openai.com/ads/measurement-pixel
  In-text citation: (OpenAI Developers, n.d.)
- OpenAI Developers. (n.d.). *Supported Events*. https://developers.openai.com/ads/supported-events
  In-text citation: (OpenAI Developers, n.d.)
- OpenAI Developers. (n.d.). *Configure more than one Pixel ID*. https://developers.openai.com/ads/multiple-pixels
  In-text citation: (OpenAI Developers, n.d.)
- OpenAI. (n.d.). *OpenAI Ads Measurement Pixel GTM Template*. https://github.com/openai/ads-measurement-pixel-gtm-template
  In-text citation: (OpenAI, n.d.)
- Ayuda de Google Tag Manager. (n.d.). *Compatibilidad con el modo de consentimiento de Tag Manager*. https://support.google.com/tagmanager/answer/10718549?hl=es
  In-text citation: (Ayuda de Google Tag Manager, n.d.)

---

**The OpenAI pixel for ChatGPT Ads can be installed in Google Tag Manager in two ways: with the official template that OpenAI publishes in the community template gallery, without writing code, or with custom HTML tags.** The template is the simplest path for most sites. Custom tags make sense when you need to control the pixel's own consent, for example to revoke permission during the visit.

This article explains what to prepare beforehand, how to set up each option, how to handle consent and how to validate the installation. What is stated about the pixel comes from the [official OpenAI documentation](https://developers.openai.com/ads/measurement-pixel) and from the template's published code, consulted on November 18, 2026. For an overview of the platform, see the [ChatGPT Ads guide](https://cookingmetrics.com/blog/chatgpt-ads-guia/).

## In summary

- OpenAI publishes the "OpenAI Ads Measurement Pixel" template in the Tag Manager gallery. Each tag sends one event and loads the pixel by itself; the base tag is optional.
- The template's code does not send the pixel's consent command. If the site needs prior consent, you must prevent the tag from firing, using Tag Manager's consent settings or conditions on the triggers.
- The pixel treats consent as granted unless it is denied before it is initialized. If you need to revoke it during the visit and delete its cookies, you need custom HTML tags that call `oaiq("consent", false)`.
- Each event must fire when the action is completed, with an exact-match event trigger, and only once. It is not advisable to replace it with a click or with the URL of a thank-you page.
- Validation combines Tag Manager's preview mode, the browser console and the pixel's test session in Ads Manager.

## What to prepare before installing

Before opening Tag Manager, it helps to have four things settled:

1. **The pixel ID.** It is created in Ads Manager, in the Conversions tab. It is the same for all the tags in the container.
2. **The events to be measured.** OpenAI defines [standard events](https://developers.openai.com/ads/supported-events) such as `page_viewed`, `lead_created`, `order_created` or `appointment_scheduled`. Campaigns optimized for conversions support only standard events.
3. **The signal for each event in the data layer.** Each conversion needs its own event in the dataLayer, sent when the action is confirmed. If the site measures ecommerce for Google Analytics, CookingMetrics' GA4 ecommerce guide describes those events; the mapping to OpenAI's events is covered in the article on the GA4 ecommerce dataLayer and ChatGPT Ads events.
4. **The consent rule.** You need to know whether the applicable law requires prior consent for advertising measurement and how the CMP exposes the visitor's decision.

<img src="/assets/blog/interiores-desarrollo/gtm-01-v05.webp" width="1600" height="1000" alt="Checklist with four preparations for installing the pixel: ID, standard events, dataLayer and consent." loading="lazy" decoding="async">

*Conceptual preparation sequence; the specific values are filled in for each implementation.*

## Option 1: the official OpenAI template

The [OpenAI Ads Measurement Pixel](https://tagmanager.google.com/gallery/#/owners/openai/templates/ads-measurement-pixel-gtm-template) template appears in the gallery with the author `openai` and points to an [official OpenAI repository](https://github.com/openai/ads-measurement-pixel-gtm-template). Its description states that it loads the pixel and sends page views or conversions without custom HTML.

### Add the template to the container

1. In Tag Manager, open **Templates** and, under **Tag Templates**, select **Search Gallery**.
2. Search for "OpenAI Ads Measurement Pixel" and verify that the author is `openai`. The gallery also shows third-party templates with similar names.
3. Review the permissions it requests: inject scripts, read container data, write to the console and access global variables. They are consistent with what a pixel does, but the site's security officer should be aware of them.
4. Add the template to the workspace.

### Create one tag per event

According to the [repository README](https://github.com/openai/ads-measurement-pixel-gtm-template), you create one tag for each event you want to measure:

1. Enter the pixel ID. We recommend storing it in a Constant variable and using that variable in all the tags, so you do not copy it by hand.
2. Leave the option to send an event when the tag fires turned on.
3. Choose the event and fill in the relevant fields: amount and currency, contents, plan identifier or custom event name.
4. If the same conversion is also sent from the server, fill in the **Event ID** field with a data layer variable that carries a unique identifier for that conversion.
5. Assign the event trigger and save.

Amounts are sent as whole numbers in minor units: USD 25.99 is sent as `2599`. According to its code, the template validates that the value has digits only. The template also supports an optional base tag, with no event, on the Initialization trigger; it is not required because each event tag initializes the pixel.

### Consent with the template

The template's published code does not call the pixel's `consent` command. Since the pixel [treats consent as granted](https://developers.openai.com/ads/measurement-pixel) as long as it is not denied, the protection has to live in Tag Manager: if the tag does not fire, the pixel is not loaded.

Tag Manager offers two ways to do this:

- **The tag's consent settings.** Under **Advanced Settings > Consent Settings**, the option to require additional consent makes the tag run only if the indicated types are granted, according to the [Tag Manager help](https://support.google.com/tagmanager/answer/10718549?hl=en). It works if the CMP updates consent mode, for example the `ad_storage` type.
- **Conditions on the triggers.** If the CMP publishes its decision in the data layer under its own names, you can require that condition on each trigger.

Neither revokes the permission of a pixel that is already loaded. If the visitor withdraws consent in the middle of the visit, subsequent tags stop firing, but the pixel does not receive `oaiq("consent", false)`, which according to OpenAI is the command that deletes its `__oppref` and `__obref` cookies. When that behavior is a requirement, option 2 is the right one. The article on [consent and the OpenAI pixel](https://cookingmetrics.com/blog/pixel-openai-consentimiento-cmp/) covers these cases in depth.

<img src="/assets/blog/interiores-desarrollo/gtm-02-v05.webp" width="1600" height="1000" alt="Two alternative routes to install the pixel: official template or custom HTML, both connected to a measured event." loading="lazy" decoding="async">

*The two routes are implementation alternatives; the choice depends on the consent control and maintenance required.*

## Option 2: custom HTML tags

The second option replaces the template with custom HTML tags that call the pixel directly. It requires more maintenance, but it lets you control the pixel's own consent and deduplication within the page. The architecture we use has four pieces:

- **A base tag** on the Initialization trigger. It defines the measurement functions, sets `consent` to `false` before `init` and loads the SDK only when permission is granted.
- **One tag per event**, with an exact-match custom event trigger. Each one checks the permission again before measuring.
- **A permission update tag**, fired by the CMP event, with no additional consent checks. That way it can also run when the visitor revokes.
- **A duplicate control** that prevents sending the same event twice on the same page and requires an opaque identifier for conversions, never an email or a phone number.

If the page initializes more than one pixel, for example for two brands, it is advisable to send with `measureSingle`, which according to the [multiple pixels documentation](https://developers.openai.com/ads/multiple-pixels) directs the event to a single pixel. `measure` sends it to all the initialized ones.


[Section for signed-in readers, level C: https://cookingmetrics.com/blog/pixel-openai-chatgpt-ads-google-tag-manager/#bloque-1]


## Triggers: when each tag fires

The trigger determines what is measured, and a poorly chosen trigger produces data that looks correct. These are the rules we apply:

- **Base or initialization tag:** Initialization trigger, once per page. OpenAI recommends that the pixel load early so as not to lose conversions.
- **Page view:** once per document. In a single-page application, each meaningful navigation needs its own event in the data layer; the automatic view does not guarantee it.
- **Conversions:** custom event with the exact name the site sends when the action is confirmed. A click on the submit button, the DOM Ready event or the URL of a thank-you page do not confirm that the action took place.
- **A single installation:** if the pixel is already in the site's code or in another tag, do not add the template. Two installations duplicate events.

<img src="/assets/blog/interiores-desarrollo/gtm-03-v05.webp" width="1600" height="1000" alt="Timeline showing that the conversion is measured after the confirmed action, not simply on click." loading="lazy" decoding="async">

*Conceptual firing example: measure the confirmed action and avoid ambiguous substitutes.*

## How to validate the installation

Validation has three layers, and it is best to go through them in order:

1. **Tag Manager preview.** Check that each tag fires with its trigger and only with it. According to the official template's code, the pixel's debug mode is activated automatically in preview and leaves logs in the console. A paused tag does not fire: to test it you must resume it in the workspace, without publishing.
2. **Browser console and Network tab.** With permission denied, `oaiq.min.js` must not load; with permission granted, it must load only once and the events must go out to `bzr.openai.com`.
3. **Test session in Ads Manager.** In Conversions > Data Source, the web pixel menu offers **Test**. OpenAI states that the session tags events for a maximum of 30 minutes, only on the same origin, that it may show a sample if the volume is high and that those events count in the normal statistics.

If the site applies a content security policy (CSP), it must allow `https://bzrcdn.openai.com` in `script-src` and `connect-src`, and `https://bzr.openai.com` in `connect-src` and `img-src`, according to the pixel documentation.

<img src="/assets/blog/interiores-desarrollo/gtm-04-v05.webp" width="1600" height="1000" alt="Conceptual validation ladder connecting Tag Manager preview, the browser console and the pixel test session." loading="lazy" decoding="async">

*Proposed validation path; the diagram does not claim that a test has been run or received.*

## Troubleshooting

- **No events reach Ads Manager:** check that permission is granted, that the CSP allows the OpenAI domains and that there is no ad blocker in the test browser.
- **Events arrive duplicated:** look for a second installation of the pixel, in the site's code, in another tag, or in the template and a custom tag at the same time.
- **The event is rejected or shows no amounts:** amounts and quantities must be whole numbers in minor units, and contents must use only the documented fields.
- **The custom event does not appear:** its name must be between 1 and 64 characters, use letters, numbers, hyphens or underscores, start and end with a letter or number, and not match a standard event.
- **Conversions are not attributed to the ads:** check that the site's redirects preserve the `oppref` parameter that the click adds. The differences with Google Analytics are covered in [how to measure AI assistant traffic](https://cookingmetrics.com/blog/como-medir-trafico-asistentes-ia/) and in the article on ChatGPT Ads in GA4.

## What we learned preparing it on our site

In October 2026 we prepared the measurement of cookingmetrics.com with custom HTML tags: seven tags for loading the pixel, consent, page views, confirmed bookings and booking attempts. We chose that route because our CMP publishes its decision with its own event and we needed a revocation to reach the pixel. The import into the container worked, and the tags remain paused for two reasons unrelated to Tag Manager: the CMP did not yet declare OpenAI as an advertising provider, and we could not confirm the completed-booking signal in the data layer.

The practical lesson is that installation is the easy part. What determines whether the measurement is useful is consent and the success signal for each conversion, and neither is resolved inside Tag Manager.

## Limits

- The official template has only one published version. Its fields and behavior may change; review the repository before each implementation.
- The code in this guide was not tested against the real OpenAI SDK or on a production site.
- Third-party templates in the gallery were not evaluated for this article.
- Validation confirms that events go out and arrive, not that conversions are attributed to a campaign.

## What to do next

Before resuming or publishing any tag, resolve consent and the success signal for each conversion. To measure leads and bookings, see the article on measuring leads and bookings for ChatGPT Ads. If the same conversion is also sent from the server, the article on the Conversions API explains how to share the event identifier.

At [CookingMetrics](https://cookingmetrics.com/) we review Tag Manager containers and their measurement before adding a new channel. The [GA4 audit](https://cookingmetrics.com/es/servicios/auditoria-ga4/) includes that review.

## Frequently asked questions

### Is OpenAI's template in Tag Manager official?

The gallery shows it with the author `openai` and links to a repository of the OpenAI organization on GitHub and to the pixel documentation. Google clarifies in the gallery that third-party templates are not provided by Google.

### Do I need a base tag in addition to the event tags?

Not with the official template: each event tag initializes the pixel. The base tag is useful if you want to load the pixel early on all pages, as long as the consent rule is respected.

### Can I use the template and custom HTML tags at the same time?

Not for the same pixel and the same events: sends and SDK loads would be duplicated. It is best to choose one route per container.

### How do I know if the pixel respects consent?

With permission denied, the Network tab must not show the loading of `oaiq.min.js` or any sends to `bzr.openai.com`. Repeat the test after granting and after revoking the permission.

---

## About the author

**[Martín Garay](https://cookingmetrics.com/about-martin-garay/)** — Founder of CookingMetrics

I'm Martín Garay, founder and Martech Advisor at CookingMetrics and Chair of the Technology Committee at CACE, Argentina's ecommerce chamber. For more than 20 years I've worked in Analytics, development, technical SEO and ecommerce: I implement measurement, find where it breaks and turn it into information you can act on.

### My work at CACE, Argentina's ecommerce chamber

- **Chair of the Technology Committee** (SINCE AUGUST 2025): I set the committee's agenda together with Gabriel Topola, vice-chair. We look at the platforms and tools an online business needs to grow: CMS, integrations, customer service and omnichannel operations.
- **Curating the technical forum** (IT CAMP · ECOMMERCE DAY ARGENTINA): With CACE's Events team I put together the IT Camp programme: talks for engineering and development teams on platform architecture, code and good practice, given by speakers who do the implementation work.
- **Marketing and Data Analytics committees** (SINCE 2016): I started in the Marketing committee and helped create the Data Analytics committee. I gave Google Analytics webinars, including the migration to GA4, and worked on the Google Analytics implementation for Hot Sale and Cyber Monday.
- **Ecommerce metrics dashboard** (FOR MEMBERS): With the Data Analytics committee and the CACE Community team we built a dashboard in Google Analytics and Looker Studio so each member can check the key indicators of their own store.

### Talks

- [From SEO to GEO: what it takes for a brand to be cited by an answer engine](https://www.youtube.com/watch?v=mlyjuSBdMzI) — ECOMMERCE DAY ARGENTINA 2026 · IT CAMP · AUGUST 27, 2026 · BUENOS AIRES CONVENTION CENTER
- [SEO for AI: how to prepare a brand to show up in ChatGPT and Google's AI overviews](https://www.youtube.com/watch?v=4dI7jqnLg-M) — AI IN LATAM 2025 · BUENOS AIRES · OVER 3,500 ATTENDEES AND 100 SPEAKERS, PER THE ORGANIZERS

### Profiles and links

- [Full profile](https://cookingmetrics.com/about-martin-garay/)
- [LinkedIn](https://www.linkedin.com/in/seospecialistmartingaray/)
- [Instagram](https://www.instagram.com/garaymartin/)
- [YouTube](https://www.youtube.com/@MartinGaray)
- [martingaray.com.ar](https://www.martingaray.com.ar/)
- [Chair of the Technology Committee at CACE, Argentina's ecommerce chamber](https://cace.org.ar/pages/comision-de-tecnologia?utm_source=cookingmetrics.com&utm_medium=referral&utm_campaign=perfil-martin&utm_content=caja-autor)
- [Ecommerce metrics dashboard, free for CACE members](https://cace.org.ar/pages/dashboard-de-metricas?utm_source=cookingmetrics.com&utm_medium=referral&utm_campaign=perfil-martin&utm_content=caja-autor)

---

## About CookingMetrics

CookingMetrics provides Google Analytics consulting, measurement implementation and SEO. Founder Martín Garay brings more than 20 years of experience in Analytics, development and ecommerce. The work connects data with business decisions.

### Services

- **[Google Analytics audit](https://cookingmetrics.com/data-analytics-consulting/)**: Do purchases or revenue differ from your store? We review your measurement and deliver a correction plan in 10 business days. [See the audit scope](https://cookingmetrics.com/data-analytics-consulting/).
- **[Google Tag Manager](https://cookingmetrics.com/services/gtm/)**: Did events stop being tracked after a website change? We review tags, triggers and versions to find duplicates or missing data. [Ask about Google Tag Manager audits and implementation](https://cookingmetrics.com/services/gtm/).
- **[Server-side measurement](https://cookingmetrics.com/services/cookieless-tracking/)**: We assess how to send data from your server, respect consent and prevent duplication. [What's included in server-side measurement](https://cookingmetrics.com/services/cookieless-tracking/).
- **[Technical SEO](https://cookingmetrics.com/services/technical-seo/)**: Have you migrated your site, or are pages missing from Google? We review crawling, indexing, structure and performance. [How we approach technical SEO](https://cookingmetrics.com/services/technical-seo/).
- **[SEO for AI search (GEO)](https://cookingmetrics.com/services/seo-ai-geo/)**: We review whether search engines and assistants can access your pages and understand their content. [What we can improve for AI search](https://cookingmetrics.com/services/seo-ai-geo/).

**Let's talk about your measurement:** [Contact us](https://cookingmetrics.com/about-martin-garay/) · [CookingMetrics](https://cookingmetrics.com/)
