leadstoolpack

Home › How-tos › The Secret Setups › Microsoft Ads

The Secret Setups · 14 of 20

How to set up Microsoft Ads UET events in Tag Manager

Live guide · Checked 28 October 2026 · Updated 28 October 2026 · Checked every week against Microsoft Ads's own help pages

Install the Microsoft Advertising UET tag through Tag Manager, send lead and purchase events from your dataLayer, and turn on UET consent mode.

Time
20 minutes
You will need
  • A Microsoft Advertising account
  • Google Tag Manager with the generate_lead trigger
  • Consent Mode set up
Stuck?
Troubleshooting or ask us a question

Step by step

  1. Make a UET tag

    In Microsoft Advertising go to Tools > Conversion tracking > UET tag > Create. Name it and copy the Tag ID (a number).

  2. Add it in Tag Manager

    Tags > New > Microsoft Advertising Universal Event Tracking (in the Community Template Gallery). Enter the Tag ID, fire on All Pages. Or a Custom HTML tag:

    HTML
    <script>
    (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"YOUR_TAG_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");
    </script>
  3. Set UET consent

    Microsoft has its own consent mode. Add this to your Consent Initialization defaults tag, and the update to your Accept handler:

    JavaScript
    // default, before UET loads
    window.uetq = window.uetq || [];
    window.uetq.push('consent', 'default', { ad_storage: 'denied' });
    
    // when people accept
    window.uetq.push('consent', 'update', { ad_storage: 'granted' });
  4. Send leads

    A Custom HTML tag on CE - generate_lead:

    HTML
    <script>
      window.uetq = window.uetq || [];
      window.uetq.push('event', 'submit_lead_form', {
        event_category: '{{DLV - lead_type}}',
        event_label: '{{DLV - form_id}}',
        revenue_value: {{DLV - value}},
        currency: '{{DLV - currency}}'
      });
    </script>
  5. Make the conversion goal

    In Microsoft Advertising: Conversions > Conversion goals > Create. Choose Website, category Submit lead form, type Event, and set Action equals submit_lead_form. Pick your UET tag and save.

  6. Test with UET Tag Helper

    Install the UET Tag Helper browser extension, send a test lead and check the event shows with your values. Publish in Tag Manager. The goal's status becomes Recording conversions within a day.

Tips from people who set these up every week

  • Microsoft can import your Google Ads campaigns: the UET goal is what it needs to bid well.
  • For shops, push 'purchase' with revenue_value and currency the same way, and make a Purchase goal.

Troubleshooting: questions and answers

The goal says 'Tag inactive'.

The UET tag hasn't been seen for a while. Check it fires on All Pages after consent in Preview.

Official help pages

Let Claude fix the rest of your funnel

Lead Focus is 12 Claude Skills that find the stage of your funnel that's costing you leads, then fix it: ads, landing pages, follow-ups and tracking. One payment, 12 months of updates, and a 14-day refund.

Get Lead Focus · $29.99

Still stuck, or have a question?

Tell us where you got to and what you see. We read every message and reply by email, usually the same working day.