We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more by reading our Privacy Policy.
OpenAI Pixel and Conversions API for Magento Adobe Commerce
Adds OpenAI Pixel (ChatGPT Ads Measurement Pixel) and OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API) with standard events code on appropriate pages. Supports Advanced Matching and has the ability to add custom parameters. Easy to install and use.
Magento 2 Current Extension Version: 1.0.0
Compatibility
Open Source (CE): 2.0*, 2.1*, 2.2, 2.3, 2.4
Commerce using on-prem (EE): 2.2, 2.3, 2.4
Commerce on Cloud (ECE): 2.2, 2.3, 2.4
* Contact us.
Compatible with Breeze
Compatible with Hyvä
Compatible with Breeze frontend!
Compatible with Hyvä frontend!
Add OpenAI Pixel (ChatGPT Ads Measurement Pixel) and OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API) To Magento With Just A Few Clicks!
Compatible with Magento v2 Adobe Commerce - Open Source (CE), Commerce on-prem (EE), and Commerce on Cloud (ECE)!
Works great with Catalog Product Feed!
The OpenAI Pixel (formally known as the ChatGPT Ads Measurement Pixel) is a JavaScript tracking code and browser SDK provided by OpenAI for advertisers running ads inside ChatGPT.
The OpenAI Pixel (formerly known as the ChatGPT Ads Measurement Pixel) is a JavaScript code and browser SDK provided by OpenAI for advertisers running ads inside ChatGPT. OpenAI Pixel enables you to measure, optimize, and build audiences for your ad campaigns. Using the OpenAI Pixel (ChatGPT Ads Measurement Pixel), you can leverage the actions people take on your website across devices to inform more effective OpenAI advertising campaigns.
The OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API) (for web) allows advertisers to send web events from their servers directly to OpenAI. Server-side events are linked to a pixel and are processed like browser pixel events. This means that server-side events are used in measurement, reporting, and optimization in the same way as browser pixel events.
In recent years, the Pixel can be blocked by iOS updates, web browsers' privacy features, third-party privacy plugins, and cookie blockers. However, Conversions API cannot be blocked by iOS updates, web browser privacy features, third-party privacy plugins, cookie blockers, or anything else on a visitor's/customer's side. That is why it is imperative to send both Pixel and Conversions API events simultaneously.
Apptrian OpenAI Pixel and Conversions API extension for Magento adds OpenAI Pixel (ChatGPT Ads Measurement Pixel) with standard events code on CMS pages (including the home page), category pages, product pages, catalog search pages, catalog advanced search pages, contact page, customer registration page, checkout page (default Magento one but also any other without any coding, only by typing page handle (full action name) into our extension config.), and checkout success page. The extension supports Advanced Matching and has the ability to add custom parameters.
Optionally OpenAI Pixel (ChatGPT Ads Measurement Pixel) block can be added to any other Magento page or any other extension page (blogs, form pages, etc.) via our extension config by typing page handle (full action name). The OpenAI Pixel (ChatGPT Ads Measurement Pixel) allows you to place a single pixel on your entire website to report conversions, build audiences and get rich insights into how people use your website.
Conversion measurement lets you track actions people take after viewing your OpenAI Ads across multiple devices, including mobile phones, tablets, and desktop computers. By creating a OpenAI Pixel (ChatGPT Ads Measurement Pixel) and adding it to the pages of your website where conversions happen, like the checkout page, you will see who converts as a result of your OpenAI Ads. The pixel will continue to monitor the actions people take after clicking on your ad. You can see which device they saw the ad on and which device they ultimately converted on.
Compatible with Breeze frontend without the need for an additional compatibility module. It works out of the box via the convenient Compatibility Mode option in config.
Compatible with Hyvä frontend without the need for an additional compatibility module. It works out of the box via the convenient Compatibility Mode option in config.
Account & Pricing
To use this extension, a free OpenAI Ads Manager account is required.
NOTE: OpenAI advertising service is not free; additional charges apply to users running OpenAI Ad Campaigns.
Features
OpenAI Pixel (ChatGPT Ads Measurement Pixel)
- An easy way to enable or disable OpenAI Pixel (ChatGPT Ads Measurement Pixel).
- Optimized loading of the base code.
- Advanced Matching supported.
- Works out of the box just type your OpenAI Pixel ID (or comma-separated IDs for multipixel setups) in our extension config.
- Option to type page handles (full action names) where you want OpenAI Pixel (ChatGPT Ads Measurement Pixel). Using this option OpenAI Pixel (ChatGPT Ads Measurement Pixel) can be added to any other Magento page or any other extension page (blogs, form pages, etc.).
- Option to enable or disable the OpenAI Pixel (ChatGPT Ads Measurement Pixel) base code.
- Option to enable or disable the OpenAI Pixel (ChatGPT Ads Measurement Pixel) noscript tag.
- Option to enable debug mode.
- Individual options to enable or disable AddPaymentInfo (custom), AddToCart (items_added), AddToWishlist (items_added), CompleteRegistration (registration_completed), Contact (lead_created), CustomizeProduct (items_added), InitiateCheckout (checkout_started), PageView (page_viewed), Purchase (order_created), Search (custom), and ViewContent (contents_viewed) events.
- Option to fire PageView (page_viewed) event with other events: CompleteRegistration (registration_completed), Contact (lead_created), InitiateCheckout (checkout_started), Purchase (order_created), Search (custom), and ViewContent (contents_viewed).
- Options to detect selected SKUs for all product types including bundle, configurable, and grouped products. WARNING! *
* WARNING! OpenAI Pixel (ChatGPT Ads Measurement Pixel) (browser-side) detection of selected SKUs feature is heavily dependent on the theme you are using and its customization. It is impossible to predict all possible themes and customizations. Because of this detection will not work on every theme. This is why extension default configuration comes with this feature turned off. You can turn it on and try it out. If it is working for you leave it on otherwise, turn it off. If you are a developer you will be pleased to know that everything is conveniently located in code.phtml file. To make it work, in some cases only the adjustment of a few JavaScript selectors is needed in others complete rewrite of the detection code is needed. Because of this, we do not give any warranty for the detection feature, nor it is covered by our support.
OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API)
- An easy way to enable or disable OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API).
- Advanced Matching supported.
- Option to type your OpenAI Conversions API Key in our extension config.
- Option to type your OpenAI API Version in our extension config.
- Option to type your Test Event Code in our extension config.
- Option to log server-side fired events in the Magento log file.
- Individual options to enable or disable AddPaymentInfo (custom), AddToCart (items_added), AddToWishlist (items_added), CompleteRegistration (registration_completed), Contact (lead_created), CustomizeProduct (items_added), InitiateCheckout (checkout_started), PageView (page_viewed), Purchase (order_created), Search (custom), and ViewContent (contents_viewed) events. * Notice
- Option to fire PageView (page_viewed) event with other events: CompleteRegistration (registration_completed), Contact (lead_created), InitiateCheckout (checkout_started), Purchase (order_created), Search (custom), and ViewContent (contents_viewed).
- Options to detect selected SKUs for all product types including bundle, configurable, and grouped products.
* Notice Since version 1.0.0 you can send both the OpenAI Pixel (ChatGPT Ads Measurement Pixel) event and OpenAI Conversions API (OpenAI Ads Conversions API / OpenAI Server-Side API) event simultaneously. The server-side events are not visible in the OpenAI Pixel Helper extension for Chrome. You can see server-side events in your OpenAI Ads Manager.
Category (Category Page)
- Option to type page handles (full action names) where you want category-related code.
- Option to type the event name you want to use for category tracking.
- Options to add custom parameters to your category-related event with parameters to attributes mapping. Example: google_product_category=google_product_category|name=name. The format is simple param1=attribute1|param2=attribute2 OpenAI Pixel (ChatGPT Ads Measurement Pixel) custom parameter and Magento category attribute are connected by = sign and pairs are separated by | sign.
Contact (Contact Page)
- Option to type page handles (full action names) where you want contact-related code.
- Option to type the event name you want to use for contact tracking.
- Option to type the contact form submit button selector.
Product (AddToCart (items_added), AddToWishlist (items_added), CustomizeProduct (items_added), ViewContent (contents_viewed) Events)
- Option to type page handles (full action names) where you want product-related code.
- Option to select SKU you want to use for bundle products. Options: Product SKU as (id), Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for configurable products. Options: Product SKU as (id), Child SKU as (id), Child SKU as (id) and Product SKU as (group_id)
- Option to select SKU you want to use for downloadable products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for grouped products. Options: Product SKU as (id), Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for simple products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for virtual products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Options to add custom parameters to your product-related events with parameters to attributes mapping. Example: google_product_category=google_product_category|color=color. The format is simple param1=attribute1|param2=attribute2 OpenAI Pixel (ChatGPT Ads Measurement Pixel) custom parameter and Magento product attribute are connected by = sign and pairs are separated by | sign.
Quote (Checkout Page - InitiateCheckout (checkout_started), AddPaymentInfo (custom) Events)
- Option to type page handles (full action names) where you want quote-related code.
- Option to select SKU you want to use for bundle products. Options: Product SKU as (id), Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for configurable products. Options: Product SKU as (id), Child SKU as (id), Child SKU as (id) and Product SKU as (group_id)
- Option to select SKU you want to use for downloadable products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for grouped products. Options: Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for simple products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for virtual products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to type parameter name if you want to use Magento quote ID.
- Options to add custom parameters to your quote-related event with parameters to attributes mapping. Example: google_product_category=google_product_category|color=color. The format is simple param1=attribute1|param2=attribute2 OpenAI Pixel (ChatGPT Ads Measurement Pixel) custom parameter and Magento product attribute are connected by = sign and pairs are separated by | sign.
- Option to type the AddPaymentInfo (custom) button selector.
- Option to type the AddPaymentInfo (custom) URL hash string.
Order (Checkout Success Page - Purchase (order_created) Event)
- Option to type page handles (full action names) where you want order-related code.
- Option to select SKU you want to use for bundle products. Options: Product SKU as (id), Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for configurable products. Options: Product SKU as (id), Child SKU as (id), Child SKU as (id) and Product SKU as (group_id)
- Option to select SKU you want to use for downloadable products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for grouped products. Options: Children SKUs as (id)s, Children SKUs as (id)s and Product SKU as (group_id)
- Option to select SKU you want to use for simple products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to select SKU you want to use for virtual products. Options: Product SKU as (id), Product SKU as (id) and Parent SKU as (group_id)
- Option to type parameter name if you want to use Magento order ID.
- Option to type parameter name if you want to use Magento order increment ID.
- Option to type parameter name if you want to use Magento quote ID.
- Options to add custom parameters to your order-related event with parameters to attributes mapping. Example: google_product_category=google_product_category|color=color. The format is simple param1=attribute1|param2=attribute2 OpenAI Pixel (ChatGPT Ads Measurement Pixel) custom parameter and Magento product attribute are connected by = sign and pairs are separated by | sign.
Search (Search Result Page - Search Event)
- Option to type page handles (full action names) where you want search-related code.
- Option to type the event name you want to use for search tracking.
- Option to type the parameter name you want to use for search tracking.
- Option to type request parameters you want to include for search tracking.
Miscellaneous
- Option to select OpenAI product identifier. Magento product SKU (Recommended) or Magento product ID.
- Option for Advanced Matching data mapping. Example: external_id=external_id|em=em|ph=ph. The format is simple param1=key1|param2=key2 OpenAI parameter and data key are connected by = sign and pairs are separated by | sign. Available customer data keys are: em, ph, fn, ln, ge, db, ct, st, zp, country, external_id.
- Options to connect default Magento "Cookie Restriction Mode" cookie or any third-party cookie consent extension or theme customization via following options: Enable Cookie Consent, Consent Cookie Name, Consent Cookie Key, Consent Cookie Value, and Consent Button.
- Option to select Compatibility Mode depending on which frontend you are using. (Official Magento Adobe Commerce, Breeze, or Hyvä)
- Options to track orders created in the backend by a store owner or administrator.
Installation Instructions
There are several ways you can install any Magento extension. Our extension is no different. We will show you four ways to install the extension, but you must not mix them. Choose one and stick to it.
If you are unsure about how to install an extension or prefer to have a professional do it for you, please get in touch with us.
Installation via file uploading
(If you purchased the extension on our site)
If you purchased the extension on our site then unpack .zip file from /Magento2/InstallByUploadingFiles/ directory inside your Magento root.
- Run following commands on Magento root directory:
php bin/magento maintenance:enable
php bin/magento module:enable --clear-static-content Apptrian_OpenAiPixelApi
php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento maintenance:disable
php bin/magento cache:flush
Installation via Composer
(If you purchased the extension on our site)
If you purchased the extension on our site and you want to install the extension via composer public and private keys. (To find your public and private keys, login to your Apptrian.com customer account and look at the My Downloadable Products section.)
- Run following commands on Magento root directory:
php bin/magento maintenance:enable
composer config --auth http-basic.packages.apptrian.com $PUBLIC_KEY $PRIVATE_KEY
composer config repositories.apptrian-openai-pixel-and-conversions-api composer https://packages.apptrian.com/openai-pixel-and-conversions-api/
composer require apptrian/openai-pixel-and-conversions-api
php bin/magento module:enable --clear-static-content Apptrian_OpenAiPixelApi
php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento maintenance:disable
php bin/magento cache:flush
Installation via Composer by using artifact
(If you purchased the extension on our site)
If you purchased the extension on our site then copy .zip file from /Magento2/InstallWithComposer/ directory inside your MAGENTO_ROOT/vendor/apptrian/packages/ directory (create directory if does not exist).
- Run following commands on Magento root directory:
php bin/magento maintenance:enable
composer config repositories.apptrianartifacts artifact $(pwd)/vendor/apptrian/packages
composer require apptrian/openai-pixel-and-conversions-api
php bin/magento module:enable --clear-static-content Apptrian_OpenAiPixelApi
php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento maintenance:disable
php bin/magento cache:flush
Installation via Composer
(If you purchased the extension on Magento Marketplace)
If you purchased the extension on Magento Marketplace then you must use Composer. Magento Marketplace does not allow extension downloads.
- Run following commands on Magento root directory:
php bin/magento maintenance:enable
composer require apptrian/openai-pixel-and-conversions-api
php bin/magento module:enable --clear-static-content Apptrian_OpenAiPixelApi
php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento setup:static-content:deploy
php bin/magento maintenance:disable
php bin/magento cache:flush
Please make sure your Magento public and private keys are in your Magento root auth.json file. Usually, people install Magento with one Magento Marketplace account (public and private keys) and then purchase an extension with another Magento Marketplace account (different public and private keys). Check the Magento Marketplace account you used to purchase the extension and make sure its public and private keys are in the Magento root auth.json file. WARNING! if you already have keys there, be very careful because maybe some other extensions are purchased with another Magento Marketplace account.
Configuration
Our extension works out of the box. The only thing you need to do is type your Pixel ID and Conversions API Key in our extension configuration. To do this, log in to your Magento Admin and go to:
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > OpenAI Pixel (Browser-Side Settings) > OpenAI Pixel ID
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > OpenAI Conversions API (Server-Side Settings) > OpenAI Conversions API Key
See FAQ on how to get Conversions API Key.
If you are using a third-party frontend instead of the official Magento Adobe Commerce one, please select it.
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Compatibility Mode
All options are self-explanatory and have comments and tooltips. Make sure you read them.
After changing options, make sure you refresh your Magento cache.
You need to initialize events in your OpenAI Ads Manager. Log in to your OpenAI Ads Manager. Click on Conversions in the left-side menu. We will assume you already created a pixel (aka Data Source). If you did not, create a pixel first. Click on the Conversion Events tab. In the upper-right corner, click the down-facing arrow of the Create button, then select Conversion Event. The pop-up menu will show up. Select the data source (pixel). Select Base Event, also known as Event Type. Leave the Conversion name as is or modify it to your liking. Repeat this process for all 7 event types that can be mapped to Magento (checkout_started, contents_viewed, items_added, lead_created, order_created, page_viewed, registration_completed). Once this is done, visit several product pages on your site. After 30 minutes, events should appear in your OpenAI Ads Manager.
WARNING! You need to remove all other implementations of OpenAI Pixel (ChatGPT Ads Measurement Pixel) and use only our extension.
- Remove all other extensions that fire OpenAI Pixel (ChatGPT Ads Measurement Pixel).
- Remove all theme customizations that fire OpenAI Pixel (ChatGPT Ads Measurement Pixel).
- If you are using GTM (Google Tag Manager), make sure it is not firing OpenAI Pixel (ChatGPT Ads Measurement Pixel) events.
FAQ
Q: How do I get an OpenAI Conversions API Key?
A: To get a Conversions API Key, go to OpenAI Ads Manager and log in to your account. In the left menu, navigate to Conversions. Open your active web Data Source (where your Pixel ID is located). Click the key icon at the top right. A menu will show up with the Create Key button. Click the Create Key button, give it a descriptive name, then click the Create button.
Once you have your key, save it to your computer because you will not be able to see it again. Paste your Conversions Key into our extension configuration option Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > OpenAI Conversions API (Server-Side Settings) > OpenAI Conversions API Key.
Q: I cannot see any events in my OpenAI Ads Manager. Why?
A: You need to initialize events in your OpenAI Ads Manager. Log in to your OpenAI Ads Manager. Click on Conversions in the left-side menu. We will assume you already created a pixel (aka Data Source). If you did not, create a pixel first. Click on the Conversion Events tab. In the upper-right corner, click the down-facing arrow of the Create button, then select Conversion Event. The pop-up menu will show up. Select the data source (pixel). Select Base Event, also known as Event Type. Leave the Conversion name as is or modify it to your liking. Repeat this process for all 7 event types that can be mapped to Magento (checkout_started, contents_viewed, items_added, lead_created, order_created, page_viewed, registration_completed). Once this is done, visit several product pages on your site. After 30 minutes, events should appear in your OpenAI Ads Manager.
Q: The CustomizeProduct and AddToWishlist events show as AddToCart events. Why?
A: OpenAI's current specification does not have CustomizeProduct and AddToWishlist event types and clearly states: "items_added - A user adds one or more items to a cart, bundle, or selection."
Q: Is it possible to add the OpenAI Pixel (ChatGPT Ads Measurement Pixel) to other Magento pages or extension pages?
A: Yes, it is. In our extension config, use the option "Add OpenAI Pixel To" and type your page handle (full action name). For example, if you want to add OpenAI Pixel to a blog page and that blog page handle is "blog_post_view", you would type this into "Add OpenAI Pixel To" at the end. The page handle depends on a particular extension; this is just an example. Do not forget to refresh your Magento Cache.
Q: Is your extension compatible with Cookiebot?
A: Yes, it is compatible with Cookiebot. To set it up configure our extension like below.
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Enable Cookie Consent option set to Yes
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Cookie Name option set to CookieConsent
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Cookie Key option leave empty
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Cookie Value option set to marketing:true
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Consent Button option set to .CybotCookiebotDialogBodyButton
The above is just an example. The Cookie Name and the Cookie Value depend on how you set up your Cookiebot.
Q: The consent cookie implementation I use has multiple values that mean consent is given, one value is "accept-all", the other is "marketing". Can your OpenAI Pixel and Conversions API extension be configured to work with my cookie consent implementation?
A: Yes. For
Stores > Configuration > Apptrian Extensions > OpenAI Pixel and Conversions API > Miscellaneous > Cookie Value option type accept-all|marketing
The values are separated by a | (pipe sign). There is no limit on the number of values you can add this way.
Q: Why does the CustomizeProduct (items_added) event fire only once?
A: The CustomizeProduct (items_added) event has two behaviors in our extension, depending on the Detect Selected SKU options configuration.
- If the CustomizeProduct (items_added) event is enabled and Detect Selected SKU options are disabled, the CustomizeProduct (items_added) event will be fired only once per page load. The data sent with the event will be the product or parent product data (configurable/bundle/grouped).
- If the CustomizeProduct (items_added) event is enabled and Detect Selected SKU options are enabled, the CustomizeProduct (items_added) event will fire every time a customer/visitor changes something. The data sent with the event will be the variant product data (configurable) or a set of multiple products (bundle/grouped), depending on the customer/visitor selection. There are reasonable safeguards in place to prevent overfiring of the event. For example, in the case of configurable products, the event will not fire until all required options are selected, and the selection can resolve to one particular variant product. Data from the previous event will be retained and compared with the current data; if there is no change, the event will not fire.





