Blogs

Image of Chatgpt ads.openai.com home page offering services on how to implement purchase conversion tracking with WooCommerce, by After Dark Grafx in San Diego.

How to Setup Ads.Openai.com Conversion Tracking for WooCommerce

Instead of using a paid plugin, I wanted to add code to my website for FREE that would allow me to track PAGE VIEWS and ORDER CREATED (purchase events) in my Ads.OpenAI.com account.

Here is a simple tutorial on how to add conversion tracking to WooCommerce for Chatgpt.

Please Note: This code is for advanced users and we are not responsible if this code breaks your website. Always make a backup of your website with your host or add a backup plugin like Updraft or Backuply before adding or implementing any code provided here. Better yet, run this code on a development server and not on a live website that is in production.

 

Ok here we go:

a) Go to ads.openai.com and create a new campaign and walk through the steps of setting up the campaign, ad groups, ads, etc. (we are not covering that here)

 

b) Once the campaign is created, head over to TOOLS on the left then select CONVERSIONS

 

c) Top Right, select CREATE then select DATA SOURCE

 

d) Window Pops Up, Name it whatever you want, like, My Website Cool Pixel or Your Domain Name – OPENAI Pixel

 

e) Next, click on CONVERSION EVENTS TAB at the top on this same page. (ie: You should be on the Tools -> Conversions page)

 

f) Once you select the CONVERSION EVENTS TAB, select CREATE on the top right and select CONVERSION EVENT

 

g) On the window that pops up select the DATA SOURCE and select the PIXEL you just created

 

h) We are going to create two conversion events. One for PAGE VIEW and one for PURCHASE (Order Created)

 

On this same window under BASE EVENT select PAGE VIEWED and name it PAGE VIEWED -> Select CREATE

Create another event and select the PIXEL for DATA SOURCE then for BASE EVENT select ORDER CREATED and name it something like ORDER CREATED -> Select CREATE

 

i) NEXT…

 

j) Head back to the DATA SOURCE tab at the top and COPY YOUR PIXEL ID (ie: it will be the number below the NAME of the pixel. If you click on the name, it will COPY the PIXEL for you. Open up Notepad or a text editor and save this for later reference and use in the script you will download.

 

k) Next. Since we are ONLY TRACKING PAGE VIEW and PURCHASE events on our WOOCOMMERCE website, we need to add the following code to the FUNCTIONS.PHP file of the website. It is best to use a CHILD THEME and edit the FUNCTIONS.php file under the child theme (ie: If you need to understand what WooCommerce/Wordpress Child Themes Are, click here to go to : https://woocommerce.com/documentation/products/themes/storefront/child-themes/

 

l) You can download the SNIPPET you need here to add to your functions file. PLEASE MAKE A BACKUP OF YOUR WEBSITE BEFORE ADDING THIS CODE. It is also recommended that you login via FTP and download the original FUNCTIONS.PHP file or RENAME the original one and keep it on the website for a quick restore. If you don’t know what I am talking about here, then you should not be editing your functions file as you will definitely break your website. OR if you need help, you can simply hire afterdarkgrafx.com to help you 🙂

 

Please note: On the file that you download, replace PUT-YOUR-OPEN…. with your PIXEL ID 🙂

oaiq(“init”, {
pixelId: “PUT-YOUR-OPEN-AI-PIXEL-ID-HERE“,
debug: false});

 

Download The Functions Script – Here (PDF) – How To Add Open AI Conversion Pixel to WooCommerce

 

 

m) You should download the OpenAi CHATGPT Pixel Helper Chrome Extension Plugin so you can see if the purchase event is firing.

 

n) Head back over to ads.openai.com and click on TOOLS -> Conversions -> Click on the EVENT STREAM TAB at the top of the screen then select START POLLING

 

o) Once you have the extension installed and polling turned on above, you will want to create a TEST ORDER in WooCommerce. I typically will just turn on CHECK PAYMENTS and then run a quick test order to check the flow and that I am receiving the ORDER CREATED CONVERSION in the extension. Then immediately turn it off if this is a LIVE STORE.

 

p) Lastly, it will take a day or two for the PURCHASE conversions to show up. After you place your test order, head back over to ads.openai.com and click on TOOLS -> Conversions -> Click on the EVENT STREAM TAB and you should see some events there for PAGE VIEW but may not see the ORDER CREATED CONVERSIONS.

 

q) Check back in 48 hours and see if the ORDER CREATED conversion has data under TOOLS -> Conversions -> Order Created.

 

This worked for me and may not work for you, however, if you would like help  implementing chatgpt ads with ads.openai.com, please contact us here. This is a BILLABLE SERVICE, sorry.

 

We will need access to WordPress and FTP to make these changes for you.

 

Also See Full Integration with Google Tag Manager on this post (you will be sent to another website) 

Thank you,

James Byrne, Owner, Information Architect, After Dark Grafx, Since 1992.

 

Categories

RECENT BLOG POSTS