Skip to main content

Victor Serban

How to Set Up Microsoft Bing Ads Conversion Tracking Using Google Tag Manager

If you’re running Microsoft Ads (formerly Bing Ads) and want to track conversions like purchases, signups, or leads, using Google Tag Manager (GTM) makes it easy, with no need to mess about with your website’s code directly.

In this step-by-step guide, I’ll show you exactly how to set up Microsoft Ads UET (Universal Event Tracking) Tag and conversion tracking in GTM.


Note: To set up Bing Ads conversion tracking with Google Tag Manager, you must first connect GTM to your website.

Click here to view the step-by-step guide on adding Google Tag Manager to your Shopify store.

Step 1: Create a UET Tag in Microsoft Ads

1. Go to your Microsoft Ads dashboard.

2. From the right side menu, click Conversions > UET Tag.

3. Click + Create UET tag.

4. Enter a name (e.g., “Main Site UET Tag”). Make sure to uncheck the Microsoft Clarity integration box, since we are not setting up Microsoft Clarity in this step. Save and next.

5. Then select “Automatically add the tracking tag through Google Tag Manager” and click Next.

6. After that, click Done. You’ll see your Microsoft UET Tag ID (something like 12345678). Save it for later use in Google Tag Manager.


Step 2: Add the UET Tag Using GTM’s Built-In Template

1. Open your Google Tag Manager account.

2. Navigate to the Google Tag Manager account and container you selected earlier.

3. Add a new tag to your container. Click on Tags > New> Under Tag Configuration, select choose a tag type to begin setup.

4. Search for “Microsoft Advertising Universal Event Tracking” and select the tag template from the list.

5. Paste your UET Tag ID into the field. & Leave Event Type as Page Load for general tracking.

6. Set the Triggering to All Pages.

7. Click Save and Publish.

This tag is your base UET tag sorted. It’s needed before we start adding conversion events.


Step 3: Create a Conversion Goal in Microsoft Ads

1. Go back to Microsoft Ads > Tools > Conversion Goals > Click Create.

2. You’ll see the question “What kind of conversions do you want to track?” — since we’re setting this up for a website, select Website.

3. Choose a goal type (e.g., Purchase, Sign-up, or Custom Event).

4. For the Goal Type, choose Event, since we’re setting this up using Google Tag Manager.

5. Enter your event name here and choose Revenue if applicable for your goal, then click Next.

6. In the Tagging Setup step, select “Yes, the UET tag was already installed on all website pages” since we’ve already added it through Google Tag Manager.

7. And in this step, choose Manual installation.

8. If you want to set up enhanced conversion tracking, select “Turn on Enhanced conversions”. If you don’t want to use enhanced conversions, choose “I don’t want to use enhanced conversions.”

In this guide, I’m showing how to set up enhanced conversions, so I selected “Turn on Enhanced conversions.”

What is Enhanced Conversion Tracking?

Enhanced conversions improve conversion accuracy by hashing and sending customer data (e.g., email or phone number) securely to Microsoft. Microsoft then matches this data with signed-in users to track more conversions.

9. Define the Event Category, Action, Label, and optional Value. Then, under “When do you want to track this event?”, select “Track event on inline action.

⚠️ Note: For event tracking, you’ll need to match Action, Category, Label, or Value later in the GTM tag. For exemple –

  • Event Category: e.g., Purchase
  • Event Action: e.g., Completed
  • Event Label: e.g., Order Confirmation

💡 Keep note of the Event Category/Action/Label — you’ll need to match these in GTM later.

9. Click Save. You’ll now see this goal under Conversion Goals.


Step 4: Set Up the Conversion Event Tag in GTM

1. Open your Google Tag Manager account.

2. Navigate to the Google Tag Manager account and container you selected earlier.

3. Add a new tag to your container. Click on Tags > New> Under Tag Configuration, select choose a tag type to begin setup.

4. Search for “Microsoft Advertising Universal Event Tracking” and select the tag template from the list.

5. Paste your UET Tag ID into the field. Under Event Type, choose Custom.

Fill in the Event Parameters to match what you entered in Microsoft Ads:

  • Event Category: e.g., Purchase
  • Event Action: e.g., Completed
  • Event Label: e.g., Order Confirmation

Event Value & Currency (optional): You can use a GTM variable like {{Transaction Value}}{{currency}}

6. Under Triggering, select the trigger based on your conversion:

  • For thank you pages: Use a Page View trigger like Page URL contains /thank-you
  • For form submissions or clicks: Use a Click Trigger or Form Submission trigger

Or, if your data includes a specific event — like in my case, when someone completes a transaction, I have a purchase event — you can create a custom event trigger in GTM and select that for your conversion tracking.

7. Click Save and Publish.

Step 5: Set Up Enhanced Conversions by Sending User Data via GTM


If you selected “Turn on Enhanced conversions” during goal setup in Microsoft Ads, you’ll need to pass user-provided data (like email, phone number, or name) using Google Tag Manager. This allows Microsoft to match more conversions, especially from iOS or privacy-restricted browsers.

How to Capture and Send User Data with GTM

You can push user data to GTM’s data layer and send it with your Bing Ads tag.


Example Setup:

1. Push User Data to the Data Layer (Custom Code)

On your thank-you page (or after form submission or purchase ), push data like this:

html
CopyEdit
<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    event: "purchase",
    user_email: "john.doe@example.com",
    user_phone: "1234567890",
    user_name: "John Doe",
    transaction_value: 49.99
  });
</script>

Tip: If you’re on Shopify, you can place this code inside the order confirmation page or use Liquid variables to auto-fill the values.


2. Create Variables in GTM to Read This Data

Go to Variables > User-Defined Variables > New > Data Layer Variable, and create the following:

  • DLV - user_emailuser_email
  • DLV - user_phoneuser_phone

To capture the Email for Enhanced Conversion Tracking, we need to create a variable in Google Tag Manager.

To capture the phone number for Enhanced Conversion Tracking, we need to create a variable in Google Tag Manager.

Now, we need to create a Custom JavaScript variable in Google Tag Manager to format the user data properly for Microsoft Ads Enhanced Conversion Tracking.

Follow these steps:

  1. Go to Variables in GTM.
  2. Click New → Select Variable Type: Custom JavaScript.
  3. Name it something like: js - Microsoft User Data
  4. Paste the following code into the custom JS field:
function() {
  return {
    email: {{DLV - user_email}},
    phone_number: {{DLV - user_phone}}
  }
}

  1. Click Save.

This variable will send the user’s email and phone number in the correct format Microsoft requires.

Make sure the {{dlv - email}} and {{dlv - phone}} variables already exist and are pulling data correctly from the Data Layer.


3. Add user Data with our Event.

To set up Enhanced Conversion Tracking for specific events like Lead or Purchase (in our case, I’m showing a Purchase example), we need to pass user data such as email, phone number, and name along with the event.

So, reopen your Microsoft UET tag in Google Tag Manager, and click on Add parameter :

Add a new row:

  • Name: pid
  • Value: {{js - Microsoft User Data}} (This is the custom JavaScript variable you just created)

Click “Add” to confirm.

Save your tag.

Important: Don’t forget to Publish the GTM container to make your setup live.


Step 6: Monitor Conversions in Microsoft Ads

  • Go back to Microsoft Ads > Conversion Goals.
  • You should start seeing conversion data within a few hours or up to 24 hours, depending on traffic. In the meantime, you can check your UET tag status and test whether your conversion goals are set up correctly using the UET Tag Helper. You can install this browser extension on Microsoft Edge or Google Chrome.

Step 7: Step-by-Step: Verify Bing Ads UET Tag Using UET Tag Helper

  1. Install the Extension
    • Go to the Chrome Web Store and install the UET Tag Helper by Microsoft Advertising.
  2. Enable the Extension
    • After installing, pin the extension to your Chrome toolbar.
    • Click the UET Tag Helper icon and toggle it ON.

1. Visit Your Website

  • Open a new tab and go to your website where the UET tag is installed.

2. Check Tag Status

  • The extension will show you:
    • If the UET base tag is firing correctly
    • Any conversion events being triggered
    • The UET Tag ID being used
    • Whether the tag fired on page load or inline action

Bonus: Send Dynamic Conversion Values

If your site pushes revenue or order value to the Data Layer, you can use a GTM variable to pass it dynamically.

  1. In GTM, go to Variables > New.
  2. Choose Data Layer Variable.
  3. Enter the variable name (e.g., transactionValue).
  4. Use this variable in the Event Value field of your conversion tag, like {{transactionValue}}.

All done!

Congratulations! Your Bing Ads conversion tracking setup is complete.

That’s it! You’ve now set up Microsoft Bing Ads conversion tracking using Google Tag Manager’s native tag template – clean, simple, and code-free.

This method is safer and easier than custom code, and gives you complete control inside GTM.


How to set up Microsoft UET tags directly on Shopify?

Set up UET tags using Shopify

  • This article shows how to do a basic setup of UET tags using Shopify. Please refer to the Shopify Help Center for more information.
  • Microsoft Advertising is not responsible for Shopify’s processes or documentation, nor for changes made to Shopify’s processes or documentation.
  • By installing the Microsoft Advertising app for Shopify, UET tags are automatically created and added to every page of your website. Go to the Install an app page and follow the prompts to get your Microsoft Advertising app for Shopify set up.

If you created and manage your website with Shopify, you can add and manage your UET tag there.

Implementing UET using Shopify

  1. From the navigation menu on the left, hover over Conversions and select UET tag.
  2. Copy your UET tag ID. Copy UET tag
  3. Sign in to your Shopify account.
    1. Type “customer events” into the search box and select Customer events. Customer events Customer events
    2. Select the Add custom pixel button. Custom pixel
    3. Configure the privacy settings. COnfigure privacy settings
    4. Add the following code to the Code section: Edit code in the themes section of Shopify // 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:"PUT_YOUR_UET_TAG_ID_HERE", disableAutoPageView: true, enableAutoSpaTracking: false};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"); window.uetq = window.uetq || []; window.uetq.push('consent', 'update', { 'ad_storage': 'granted' }); // Step 2. Subscribe to customer events with analytics.subscribe(), and add tracking analytics.subscribe("page_viewed", (event) => { window.uetq = window.uetq || []; window.uetq.push('event', 'page_view', { 'page_location': event.context.window.location.href }); }); analytics.subscribe("all_standard_events", event => { let productIds = ''; let revenueValue = 0; let currency = ''; switch (event.name) { case "product_viewed": if (event.data?.productVariant) { productIds = String(event.data.productVariant.product.id); window.uetq = window.uetq || []; window.uetq.push('event', '', { 'ecomm_prodid': productIds, 'ecomm_pagetype': 'product' }); } break; case "cart_viewed": if (event.data?.cart) { if (Array.isArray(event.data?.cart?.lines)) { const cartItemIds = event.data.cart.lines.map(line => String(line.merchandise.product.id)); productIds = cartItemIds.join(',').slice(0, 50); } window.uetq = window.uetq || []; window.uetq.push('event', 'product_page', { 'ecomm_prodid': productIds, 'ecomm_pagetype': 'cart' }); } break; case "product_added_to_cart": if (event.data?.cartLine) { productIds = String(event.data.cartLine.merchandise.product.id); window.uetq = window.uetq || []; window.uetq.push('event', 'add_to_cart', { 'ecomm_prodid': productIds, 'ecomm_pagetype': 'cart' }); } break; case "checkout_completed": if (event.data?.checkout) { revenueValue = event.data.checkout.totalPrice?.amount; currency = event.data.checkout.totalPrice?.currencyCode; if (Array.isArray(event.data?.checkout?.lineItems)) { const lineItemIds = event.data.checkout.lineItems.map(item => String(item.variant.product.id)); productIds = lineItemIds.join(',').slice(0, 50); } window.uetq = window.uetq || []; window.uetq.push('event', 'purchase', { 'ecomm_prodid': productIds, 'ecomm_pagetype': 'purchase', 'revenue_value': revenueValue, 'currency': currency }); } break; } });
    5. At the top of the page, select the Save button. Save button
    6. Select Test and go to various pages of your website to test the new tag. Test button Test button If you use the UET tag helper for validation, please expect the warning “A UET event was fired from within an iframe.” We use the Shopify web pixel API which utilizes an iframe solution. This is expected behavior. All events are collected correctly.

Supported events

Our integration supports various types of events. This data also can be used for dynamic remarketing.

  • Page view
  • Custom events
  • Product page view (incl. Product ID)
  • Add to cart (incl. Product ID)
  • Cart view (incl. Product ID)
  • Purchase (incl. Product ID, revenue, currency)

This integration also automatically supports UET Consent Mode.

Conversion goals to create

We suggest you create conversion goals for:

  • Adding to cart (event action equals ‘add_to_cart’)
  • Purchase (event action equals ‘purchase’)

You can optimize the performance of your campaigns with conversion goals.

Hope that helps, if you need help with Bing or Google Ads, book a call with me or send an email to victor@victorserban.com

See you later :)

Leave a Reply

Your email address will not be published. Required fields are marked *