Bing/microsoft ads conversion setup with new Customer Checkout Events

Topic summary

Shopify’s deprecation of the checkout script section has disrupted Bing/Microsoft Ads conversion tracking. Users are struggling to migrate their UET (Universal Event Tracking) tags to Shopify’s new Customer Events system.

The Problem:

  • Traditional UET code placed in checkout scripts no longer works
  • Attempts to paste standard Bing conversion code result in iframe-related errors
  • Uncertainty about proper variable syntax for revenue tracking (e.g., Replace_with_Variable_Revenue_Function())

The Solution Provided:
A community member shared a working code snippet that:

  • Initializes the Bing UET SDK
  • Uses analytics.subscribe("checkout_completed") to listen for purchase events
  • Properly references Shopify’s event data structure: event.data?.checkout?.totalPrice?.amount and event.data?.checkout?.currencyCode
  • Should be added as a Custom Pixel under Settings > Customer Events

Implementation Notes:

  • After adding the custom pixel, remove old UET code from theme.liquid to prevent double-tracking
  • Connect the custom pixel after creation in Shopify settings
  • Test for several days to verify conversion tracking accuracy

Open Question:
One user asks whether conversion goals still need manual setup in Microsoft Ads, or if the pixel automatically tracks add-to-cart, checkout, and purchase events.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

So basically since shopify decided to depracate the checkout script section, our store is going nuts, trying to figure out how to setup the conversions for all the channels we used to track events for.

Now we cannot figure out what code we have to copy and paste into the new pixel section of the customer event, as whatever I paste, it just doesnt’ work and doesn’t track conversions.

The code I get to paste is this (i setup conversion using event purchase on microsoft:

window.uetq = window.uetq || ;
window.uetq.push(‘event’, ‘purchase’, {“revenue_value”:Replace_with_Variable_Revenue_Function(),“currency”:“EUR”});

However this does now work, I get this errore:

This UET tag is not set up correctly.

A UET event was fired from within an IFrame
We recommend that you place your UET tag outside of an IFrame and use a JavaScript tracking code. This placement will ensure that your conversions are accurately tracked and measured.

What the hell should we do to track bing ads revenue and conversions ?

It looks like there is no way at the moment ?

Hi @Agolab ,

Since the checkout script section is being deprecated, Shopify is providing an alternative method called “Customer Events” to add the code. We will need to convert all the existing code to Customer Events and add it there to ensure it continues to work.

If you can provide me with the base code for Bing, I will convert it to a Customer Event and provide it to you.

Thank you

Thank you, very kind of you. So the general tag is this:

And the conversion tracking is this:

Do you also know what should I use in the: Replace_with_variable_Revenue_Function ?

Is that something like event.data.checkout.totalPrice.amount ? Thanks

Hi @Agolab ,

Use can use the below code for tracking bing conversion on the site.

// Step 1. Initialize the JavaScript pixel SDK (make sure to exclude HTML)
(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"56295435", enableAutoSpaTracking: true};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");

// Step 2. Subscribe to customer events with analytics.subscribe(), and add tracking
analytics.subscribe("checkout_completed", (event) => {
    window.uetq = window.uetq || [];
    window.uetq.push('event', 'purchase', {
        "revenue_value": event.data?.checkout?.totalPrice?.amount,
        "currency": event.data?.checkout?.currencyCode
    });
});

Please go to Setting > Customer events and add a new custom pixel.

Note: After add this code, you can remove theother code that has been implemented on the theme and additional script.

Thank you

Hi.
I’m sorry but I have no idea what do you mean with point 1 and with point 2 as well.
// Step 1. Initialize the JavaScript pixel SDK (make sure to exclude HTML)
and
// Step 2. Subscribe to customer events with analytics.subscribe(), and add tracking

What should I do ?

Also, are you sure that once implemented in custom events, I can remove the code from theme.liquid file ?

Thanks

Hi @Agolab ,

These are just JS comments. You can paste the whole block into the customer events.

Regarding custom events, the event should work correctly. You should remove the code from the theme to prevent double tracking.

For reviewing, you can try the conversion for a few days and check if it works. When I reviewed it on my store, it seemed to work correctly.

After you create the customer events, make sure to connect the events.

Thank you

Amazing man, I’ll let you know after the test if it works, this has been very helpful!

Hello

Greetings

Thanks for the code. it was really helpful. I have created the pixel with the code and remove the UET code from theme.liquid file.

I have a question though

  1. Do we need to create the conversion goals in Microsoft ads after this pixel

  2. Or the pixel will tarck the add to cart, check out and purchase goals itself

Thanks in advance

best regards

Kamal

i hope is work for me .