Before you start
Deploy the account UET tag once, send a custom event only on confirmed orders, and match the goal rules against UET Tag Helper output. Test a completed action, not only a button click.
1. Install the account-generated UET base
Microsoft generates UET code with your tag ID. This current loader pattern uses a placeholder. For a live site, copy the full current snippet from your account and replace nothing except what Microsoft marks for replacement. Do not add a second base if GTM or a site integration already installs one.
<!-- UET base pattern; replace TAG_ID_HERE with your account-generated tag ID -->
<script>
(function(w,d,t,r,u) {
var f,n,i;
w[u]=w[u]||[];
f=function() {
var o={ti:"TAG_ID_HERE", 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;
if (!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>Auto SPA tracking can be inappropriate if your app already manages page-load events; use the exact configuration generated for your account. See Microsoft's UET overview. The account-generated snippet remains the source of truth for the current tag ID and options.
2. Send a real UET custom event
Create a Custom Event goal in Microsoft Advertising and make its action/category/label rules match the values sent by the page. After the base is available, send this only when an order is confirmed:
window.uetq = window.uetq || [];
window.uetq.push('event', 'purchase_complete', {
event_category: 'commerce',
event_label: 'confirmed_order',
event_value: '79.99',
revenue_value: 79.99,
currency: 'USD'
});The strings are examples. Map actual order values and configure the conversion goal to match. This uetq event call uses Microsoft's browser queue. A generic dataLayer.push is only a GTM message; it will not send a Microsoft event unless a UET tag, trigger, and variable mapping forward it.
3. Verify
Use UET Tag Helper to check tag ID, pageLoad, and the custom event; then review conversion-goal diagnostics in Microsoft Advertising. Helper detection proves local tag execution, not that a goal was counted or attributed. Reporting may lag.
Avoid firing on both click and success. A unique confirmation URL can be measured with a URL goal. Make the confirmation state safe to refresh so one order is not counted twice. Use the dashboard to inspect browser-visible values, then verify the event with UET Tag Helper and Microsoft Advertising diagnostics.
Official references
- Universal Event Tracking overview Checked November 10, 2026
- UET Tag Helper Checked November 10, 2026
- UET JavaScript tag setup Checked November 10, 2026
- UET JavaScript events and browser/CAPI deduplication Checked November 10, 2026
What changed
- v1.0Initial bilingual guide; provider setup and validation steps checked against official documentation.
- v1.1Revised both language versions with verified provider code and clearer data-layer-to-tag mapping; checked official setup and validation references.
- v1.2Replaced an older community answer with current Microsoft Learn UET JavaScript event documentation.