ChatGPT Ads extension for WooCommerce: conversions, add to cart and CAPI
The first ChatGPT Ads campaigns reached WooCommerce shops quickly, but sales tracking cannot be set up by pasting a script into the header. I have built a WordPress extension that connects WooCommerce to the OpenAI pixel and the Conversions API while respecting consent, and I install it on your site myself.
Install ChatGPT Ads tracking on my WooCommerce site
Why a simple snippet is not enough on WooCommerce
Pasting the pixel code into the theme header or a script-insertion plugin makes it look as if everything works: Ads Manager receives page views. But three things are almost always missing. First, consent: the OpenAI pixel treats visitors as consenting by default, so it fires before the banner. Second, the server-side sale: when payment is completed at Stripe, PayPal or the bank, some customers never see the thank-you page again. Third, the oppref click identifier, which the Conversions API does not pick up on its own.
On top of that come WordPress specifics: page cache plugins serving the same HTML to every visitor, AJAX add to cart on shop pages, the new block-based checkout that does not fire the same actions as the old shortcode, and orders moving to HPOS tables.
The events sent by the extension
The extension uses the standard event names documented by OpenAI:
- contents_viewed on the product page, including the variation for a variable product;
- items_added on add to cart, whether the add reloads the page or happens via AJAX from the shop;
- checkout_started when the checkout page opens, block-based or classic;
- order_created for the purchase: pixel on the thank-you page, and a server call when the order moves to “processing” or “completed”;
- registration_completed on account creation, lead_created on a quote or contact form if that is your main conversion.
If you sell subscriptions, OpenAI also provides a subscription_created event: we can look together at whether it is relevant for you.
What I fix when installing the extension
- A code-insertion plugin loading the pixel on every page, before any consent
- Card purchases only half reported because the thank-you page is not always reached
- A cache plugin freezing the landing URL and dropping the oppref parameter
- A site moved to the block-based checkout, where old tracking scripts no longer fire
- Orders counted twice when the customer reloads the thank-you page
Start with a tracking audit
Orders, metadata and HPOS
When a visitor lands from an ad, the extension reads oppref and the obref identifier, then attaches them to the WooCommerce session. When the order is created, they are copied into the order metadata through WooCommerce’s order object methods, not through direct queries on WordPress tables. That is what makes the extension compatible with HPOS, high-performance order storage, and it declares that compatibility as WooCommerce requires.
An opaque event identifier is generated at that point and stored with the order. The thank-you page pixel and the server call both use it, with the same event name and the same Pixel ID: OpenAI counts one sale only, even if the customer reloads the page. The amount is sent as an integer in the minor unit of the order currency. The billing email and phone are normalised and hashed with SHA-256 before sending, never transmitted in clear text.
The Conversions API key is entered in the extension settings, in the admin area, and never appears in code served to visitors. A log, available in the WooCommerce logs, records calls and responses, and a validation mode lets you test without saving any event at OpenAI.
Consent: Complianz, CookieYes, tarteaucitron and the rest
No OpenAI script, no cookie and no server call until the visitor accepts the marketing purpose. The extension is compatible with the most widespread WordPress consent plugins, Complianz and CookieYes first, as well as Axeptio, Cookiebot, Didomi and tarteaucitron.js through a custom service. When your banner publishes Google Consent Mode signals, the ad storage state can be used as the trigger.
The visitor’s choice is stored with the order: if they refused, the Conversions API sends nothing for it. I provide the exact list of data transmitted so you can update your privacy policy; the legal basis remains the data controller’s decision.
The installation, step by step
-
Site inventory
Theme, cache, consent and tracking plugins already active, type of checkout, payment gateways, whether HPOS is enabled.
-
OpenAI access
Pixel ID and Conversions API key created in the conversions tab of Ads Manager, with you or through delegated access.
-
Staging first
On a copy of the site when one exists, server calls in validation mode, with nothing saved at OpenAI.
-
Cache and consent
Relevant scripts excluded from JavaScript optimisation if needed, service declared in the banner, checks before and after acceptance.
-
Real test order
Full journey to payment, reading the WooCommerce log and the recent events in Ads Manager: each event once, pixel and server merged.
-
Going live
Validation mode off, the first sales monitored, and a clear note on what the extension sends and where to check it.
Request the extension or an installation
-
Install ChatGPT Ads tracking on my shop
One message through the contact form is enough: theme, cookie plugin, payment methods. I will get back to you with the steps.
-
Guide: OpenAI pixel, Conversions API and consent
How it works in detail, deduplication, oppref and the mistakes to avoid.
-
Meta pixel and Conversions API on WooCommerce
The same logic applied to Meta, with the official extension.
-
Running PrestaShop?
The ChatGPT Ads module for PrestaShop 1.7, 8 and 9.
- 2019 e-commerce developer since
- WP 5 → 6 WordPress versions covered
- 3 working languages: FR, EN, TR
- 100 % direct contact with the developer
No middleman: the person who replies is the one who works on the code.
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.