Track purchase conversions in Microsoft Ads with an event-based goal tied to Shopify checkout completion.

Why event-based goals

URL-only goals miss inline actions. Event-based goals capture purchases when the checkout completed event fires.

Create the conversion goal

  1. In Microsoft Ads, go to Tools → Conversion Goals.
  2. Click Create conversion goal.
  3. Select Website, then Purchase, then Event.

If events are unavailable in your account, try a destination URL goal containing processing?completed=true as a fallback.

Tagging

  • Action: Purchase
  • Category: Checkout

Add the pixel in Shopify

  1. Shopify admin → Settings → Customer events → Add custom pixel.
  2. Paste the UET snippet and replace the tracking ID placeholder.
  3. Subscribe to checkout_completed and push the purchase event with order value and currency.
(function(w,d,t,r,u){
  var f,n,i;
  w[u]=w[u]||[];
  f=function(){
    var o={ti:"YOUR_UET_ID", 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");

analytics.subscribe('checkout_completed', (event) => {
  window.uetq = window.uetq || [];
  window.uetq.push('event', 'purchase', {
    event_category: "checkout",
    revenue_value: event.data.checkout.totalPrice.amount,
    currency: event.data.checkout.currencyCode
  });
});

Test the setup

  1. Complete a test order on your store.
  2. Confirm the conversion appears in Microsoft Ads.
  3. Inspect network requests to verify the pixel fires on checkout completion.