Tracking

Microsoft Ads (Bing) conversion tracking on Shopify

Set up Microsoft Ads conversion tracking on Shopify: a UET tag as a custom pixel, a purchase goal, verification and the UET Conversions API.

·6 min read·By the ROASaurus team

Key takeaways
  • Microsoft Advertising (formerly Bing Ads) tracks conversions with a UET (Universal Event Tracking) tag plus conversion goals that count what the tag reports.
  • On Shopify, add the UET tag as a custom pixel under Settings › Customer events, so it also runs on checkout pages.
  • A purchase goal should use an event action such as purchase, with the order value as revenue and the order id as transaction id.
  • Verify with the UET Tag Helper extension and the tag status in Microsoft Advertising before you rely on the numbers.
  • The UET Conversions API sends events from a server, so purchases arrive even when the browser tag is blocked; Microsoft opens it per account.

Conversion tracking for Microsoft Advertising (still often called Bing Ads) on Shopify takes two parts: a UET tag that reports events from your store, and conversion goals in Microsoft Advertising that decide which of those events count as conversions. On Shopify, the tag belongs in a custom pixel, so it runs on the thank-you page as well. This guide covers the prerequisites, the setup step by step, how to verify it and how to add server-side events.

What you need first

  • A Shopify store with products and a working checkout.
  • A Microsoft Advertising account with billing set up. Feature availability differs per market, so check that your target countries are supported.
  • Access to Shopify settings, to add a custom pixel under Settings › Customer events.
  • The UET Tag Helper browser extension for Chrome or Edge (optional, but it saves time when checking the tag).
  • A consent setup that passes visitors' choices on, if your market requires consent for advertising cookies.

How UET tags and conversion goals fit together

Ad clickThe landing URL carries the msclkid click id
UET tagReports page views and events such as purchase
Conversion goalCounts events that match its rule, e.g. event action purchase
Reports and biddingConversions and revenue per campaign
The tag reports; the goal decides what counts.

One tag can feed several goals. A goal can be included in the "Conversions" column used for bidding, or kept for reporting only, much like primary and secondary conversion actions in Google Ads.

Step by step: set up conversion tracking

1. Create a UET tag

  1. Open UET tags

    In Microsoft Advertising, go to Conversions › UET tag and choose to create a new tag.

  2. Name it

    Use a name you will recognize later, such as your store's domain. Each tag has its own id, so note which one you use for the goals.

  3. Decide on Microsoft Clarity

    You can enable Microsoft Clarity on the tag for heatmaps and session recordings. Leave it off if you do not plan to use them.

  4. Copy the tag code

    Save the tag and copy the code and the tag id it shows.

2. Add the tag to Shopify as a custom pixel

Shopify no longer runs theme code or "additional scripts" on checkout and thank-you pages, so a tag only in theme.liquid cannot track purchases. A custom pixel runs on storefront and checkout pages alike:

  1. Open Customer events

    In Shopify admin, go to Settings › Customer events and add a custom pixel.

  2. Paste the code

    Paste the UET base code, then subscribe to Shopify's standard events. For checkout_completed, send window.uetq.push('event', 'purchase', { revenue_value: …, currency: …, transaction_id: … }) with the order total, currency and order id.

  3. Set the privacy permission

    Choose whether the pixel requires marketing consent. If it does, check that your cookie banner passes consent to Shopify.

  4. Connect

    Save and connect the pixel. Remove any older UET code from your theme, so pages do not load the tag twice.

3. Create a purchase conversion goal

SettingSuggested valueWhy
Goal typeEventCounts the purchase event, not a page URL
Event actionpurchase (equals)Must match the event name the tag sends
RevenueVaries, from the eventUses each order's value instead of a fixed amount
CountUniqueOne conversion per order, using the transaction id
UET tagThe tag you just installedA goal on the wrong tag never fires
Include in conversionsOn for purchaseSo smart bidding optimizes for it
A goal that matches on a URL such as /thank-you breaks when the checkout URL changes; an event goal does not.

Verify the setup

  • UET Tag Helper. Browse your store with the extension on, add a product to the cart and place a test order. It shows each tag on the page, its status and the events it sends.
  • Tag status. In Microsoft Advertising under Conversions › UET tag, the tag status changes to active once it receives events. This can take a few hours.
  • Goal status. The purchase goal shows whether it has recorded conversions recently.
  • Numbers. After a week, compare conversions with paid orders from Microsoft traffic. Conversions only count for clicks within the goal's conversion window, so expect a gap, not a mirror image.

Important notes

  • One tag per store is usually enough. Several tags on one site make goals harder to manage and can double-count.
  • Keep event names consistent. If the custom pixel sends purchase and the goal waits for Purchase, nothing counts.
  • Enable auto-tagging of the click id in your account settings, so landing URLs carry msclkid.
  • Import is not tracking. Importing Google Ads campaigns into Microsoft Advertising does not import conversion tracking; set up UET separately.

Add the UET Conversions API

Like other ad platforms, Microsoft offers a server-side route: the UET Conversions API. Your server posts events to Microsoft with the tag id, an access token from the UET tag's Conversions API settings, an event id, the msclkid, hashed email and phone, the shopper's IP address and user agent, and the order value. That way purchases still arrive when the browser tag was blocked or the thank-you page never loaded.

If you send purchases from both the browser tag and the server, follow Microsoft's guidance on event ids so a purchase is not counted twice, and watch the goal's conversion count against your orders for the first week.

Microsoft Advertising in ROASaurus

Microsoft Advertising is one of the destinations under Connections › Tracking & destinations. You enter the UET tag id and the Conversions API token (in Microsoft Advertising: UET tag › Use Conversions API › Copy token). ROASaurus then sends page views, product views (view_item), add to cart, checkout (begin_checkout) and purchases (purchase) through the UET Conversions API, with the order id as transaction id, the items, the saved msclkid, SHA-256 hashed email and phone, and the shopper's IP address and user agent. With Also load the UET tag (deduplicated) ticked on the destination, ROASaurus also loads the UET tag on the storefront and checkout and sends the same events from the browser with the server event's id, so Microsoft can keep one copy; unticked, Microsoft gets the server events only. Create event goals whose event action matches these names, at least purchase. If you keep your own browser tag instead, leave that option off, let your tag handle page views and remarketing, and make sure only one source feeds the purchase goal.

For a visitor without marketing consent, the paid order is still sent, but flagged with advertising storage denied and without a click id, as Microsoft's consent fields describe. An optional setting restates values afterwards through the Microsoft Advertising API: when an order is refunded, or its contribution margin changes when you send margin as the value, the conversion is corrected (a full refund retracts it), for purchases up to 50 days old. The destination is built from Microsoft's documentation and has not yet carried a customer's production traffic.

The ROASaurus Mac app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
The ROASaurus iPhone app showing Tracking health: a card per destination, Purchase accuracy per day for Meta, GA4 and TikTok, and accuracy per payment method. Fictional demo store, simulated data.
Data quality › Overview in the public demo (ROASaurus Demo Store, a fictional store, simulated data): accepted purchases per destination against your orders. A Microsoft Advertising destination appears here as another row.

Next step

Sources

  1. Microsoft Learn: Universal Event Tracking
  2. Microsoft Learn: UET Conversions API integration
  3. Shopify Help Center: Customer events and pixels

In ROASaurus

Keep reading

Tracking"No recent conversions" in Google Ads: causes and fixesWhat "No recent conversions" (now "Awaiting conversions") means in Google Ads, how to tell a quiet week from a broken tag, and the fix.TrackingCookieless tracking for online stores: what still worksCookieless tracking for online stores: server-side events, modeling and fingerprinting compared, what each still measures and what consent requires.TrackingGoogle Ads conversion tracking problems on ShopifyWhy Google Ads counts too few, too many or wrongly valued Shopify purchases, what each status and warning means, and a health check to find the cause.

FAQ

Questions, answered

More answers in the FAQ and the help center.

How do I add Bing Ads tracking to Shopify?

Create a UET tag in Microsoft Advertising, add it as a custom pixel under Settings › Customer events in Shopify, send a purchase event with revenue, currency and order id, and create an event goal for the purchase action.

Can I add the UET tag to theme.liquid?

Only for storefront pages. Shopify does not run theme code on checkout and thank-you pages, so purchases need the tag in a custom pixel. Using a custom pixel for everything avoids loading the tag twice.

How do I check that my UET tag works?

Use the UET Tag Helper extension while you browse and place a test order, then check that the tag and the purchase goal show as active in Microsoft Advertising.

What is the UET Conversions API?

It is Microsoft's server-to-server endpoint for UET events. A server sends events such as purchases with an event id, the click id and hashed contact data, so they arrive even when the browser tag is blocked.

Why does Microsoft Advertising show fewer conversions than my orders?

It only counts conversions from clicks within the goal's window, and the browser tag misses visitors with blockers or without consent. Server events and a correct purchase goal close part of the gap.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.