UET Tag Event Code Generator for Microsoft Ads

Generate Microsoft UET tag code — window.uetq.push for custom event goals, variable revenue, purchases and dynamic remarketing, plus Consent Mode and enhanced conversions lines — or check the UET code you already have.

Runs in your browser. Nothing is uploaded.For Microsoft

UET Event Code Generator for Microsoft Ads

1 Build or check

What do you want to do?

Optional for custom events. Use a period for decimals.

2 Your UET code / check results

Fill in the settings above — your result appears here instantly.

Next step Running LinkedIn ads too? Build the Insight Tag conversion for the same action.

Build LinkedIn conversion code

Rules last checked: against the official pages:

How to use the event generator for the Microsoft UET tag

The Microsoft UET tag reports page loads on its own; conversions with an action or a changing amount need a window.uetq.push line. This generator writes it in Microsoft's current syntax, following How to track custom events with UET and How to report variable revenue with UET.

  1. Pick what to report: a custom event goal, revenue for a destination URL goal, a purchase with products, or a dynamic remarketing page.
  2. Match your goal. Use the same action, category and label you set on the conversion goal in Microsoft Advertising.
  3. Add the amount and currency. Decimal commas are turned into periods and currencies into capitals for you.
  4. Tick consent and enhanced conversions if you need them, and add your tag ID to get the base tag too.
  5. Copy both boxes, or paste an existing setup into Check my code.
UET tag generator for Microsoft showing a window.uetq.push purchase event with revenue_value, currency and product items

What to do next: install the UET code

The base tag goes on every page, in the <head> or right after the opening <body> tag. Copy your real tag from Conversions › UET tag › View tag if you don't use box 2.

Plain HTML

  1. Paste box 2 into the shared head of your site: consent default first, then the tag, then the enhanced conversions line. Box 3 runs from your banner when a visitor accepts.
  2. Paste box 1 on the confirmation page or next to the button it tracks.

Check it with the UET Tag Helper browser extension: every page load sends a request to bat.bing.com/action/0?ti=…, and each custom event sends one more. The UET dashboard also shows whether consent signals arrive.

Common Microsoft UET errors and fixes

Why is variable revenue not tracking in Microsoft Ads?

Check the format first: 12,34 must be 12.34, and 'usd' must be 'USD'. Then check the goal: its revenue must be set to Conversion action value may vary, with a default amount.

Old ea / ec / gv syntax

Pushes like {'ec': …, 'ea': …, 'gv': …} come from the old syntax. Rewrite them as 'event', action, {…} with event_category, revenue_value and currency.

Revenue mixed with a custom event

A destination URL goal wants an empty action and only revenue and currency. If you also send category or label, decide which goal type the conversion uses and match it.

“uetq is not defined” before the tag

A push placed above the base tag fails unless window.uetq = window.uetq || []; comes first. The generated code always includes that line.

A broken bat.js address

Help pages wrap long lines, and a copied tag can end up with a space inside "//bat.bing.com/bat.js". The tag then never loads.

No consent signal for European visitors

Without Consent Mode or TCF, conversions and remarketing from the EEA, UK and Switzerland stop. Use one of them — Microsoft says never both.

Frequently asked questions

What is the Microsoft UET tag?

UET (Universal Event Tracking) is Microsoft Advertising’s site tag. The base tag loads on every page and reports page loads to bat.bing.com; extra window.uetq.push lines report actions such as purchases or sign-ups, which your conversion goals and remarketing lists use.

How do I send a custom event with UET?

window.uetq.push('event', 'generate_lead', {'event_category': 'leads', 'event_label': 'quote form', 'event_value': 1}); — the command event always comes first, then the action, then the details. Run it when the action is complete, for example from a button’s click handler.

How do I track variable revenue with UET?

Add revenue_value and currency to the push. For a destination URL goal, the action stays empty: window.uetq.push('event', '', {'revenue_value': 49.90, 'currency': 'USD'});. Then set the goal’s revenue to Conversion action value may vary, with a default amount.

Why is my variable revenue not showing in Microsoft Ads?

The usual causes: a decimal comma (12,34) instead of a period, a currency in lower case, the old gv syntax, a goal still set to a fixed value, or revenue sent with an event action to a destination URL goal. Paste your code into Check my code to find which.

How does UET consent mode work?

You send window.uetq.push('consent', 'default', {'ad_storage': 'denied'}) high in the head, and 'update' with granted once the visitor accepts. Since 5 May 2025 Microsoft enforces a consent signal for visitors in the EEA, the UK and Switzerland. Without a default, UET uses granted in most countries but denied where consent is enforced.

Can I add the UET tag with Google Tag Manager?

Yes. Put the base tag in a Custom HTML tag that fires on all pages, and each event push in its own tag with a trigger. Google Tag Manager is also on Microsoft’s list of tools that can pass consent signals to UET.

Need help setting this up? Talk to EmproIT