Microsoft Advertising Universal Event Tracking (UET) Tag Setup Guide
This article describes how to set up the Microsoft Advertising Universal Event Tracking (UET) tag.
Tag tips
- Use mapping to:
- Override the standard configuration values.
- Override the E-Commerce extension values.
- Pass custom parameters.
- Set up event triggers.
- Mapping a parameter to Custom Property/Parameter in the Standard tab sends that parameter with all events. Use the Event Parameters tab to send data only to certain events.
- Supports the following e-commerce extension values:
- Order ID.
- Order subtotal.
- Order shipping.
- Order tax.
- Order currency.
- Order coupon/promo code.
- List of product IDs.
- List of names.
- List of brands.
- List of categories.
- List of quantities.
- List of prices.
Tag configuration
Go to the tag marketplace to add a new tag. For more information, see About tags.
When adding the tag, configure the following settings:
- Tag ID: Your Microsoft Advertising tag identifier.
- ID Sync Beacon: Persist internal user IDs to Microsoft third-party cookie IDs. Recommended when using the Microsoft UET Conversion API connector.
- Ad Storage Consent: Set the default consent for Ad Storage. Dynamically update this value by mapping the
ad_storageparameter in the Data Mappings section. - Automatically read from Tealium Consent Cookie: If set to
true, consent is set based on the Tealium consent manager. - Generate Event ID: Automatically generate an event ID for every tracking event. Recommended for deduplication when using the Microsoft UET Conversion API connector
Conversions API
This feature requires an active Tealium Collect tag.
To support the Microsoft UET Conversion API, set Generate Event ID to true. When Generate Event ID is enabled, this tag generates a unique event ID for each event tracked and sends it as an attribute to Tealium EventStream for use in the Microsoft UET Conversion API connector and passes it to the Microsoft Advertising UET tag in the event_id parameter. This event ID attribute may be mapped in the connector to synchronize the web-based tag with server-side integration.
The tag sends event IDs using generated event attributes using the following naming convention:
microsoft_event_id_{EVENT_TYPE}_{TAG_UID}
For example, a purchase event from tag #88 would send the following attribute and value:
{
"microsoft_event_id_purchase_88": "028b2ade7478..."
}
A page load event from the same tag would send the following attribute and value:
{
"microsoft_event_id_pageload_88": "084b1cda7461..."
}
Deduplication
To ensure proper event deduplication, the event ID from the Microsoft Advertising UET tag must be included in the payload sent by the Tealium Collect tag. To do this, use the following steps:
- From the Tag Timing drop-down, select Prioritized.
- Set the Bundle Flag toggle to
On. - Use the Load Order Manager screen to fire the Microsoft Advertising UET tag before the Tealium Collect tag. We recommend that you fire the Tealium Collect tag last. For information on using these event ID attributes, see Microsoft UET Conversion API connector: Deduplication.
Load rules
Load the tag on all pages or set conditions for when your tag loads. For more information, see About load rules.
Consent mode
There are two options to implement consent mode for this tag:
- Use client-side consent management and automatically read the Tealium consent cookie.
- Add a JavaScript Code extension to map consent choices and category mappings from your consent management platform (CMP) to this tag.
As visitors make their consent choices, the tag will choose the appropriate approach for first and third-party cookies:
- Granted: Both first-party and third-party cookies can be read and written.
- Denied: First-party cookies are neither read nor written, and third-party cookies are read-only for fraud and spam purposes, not for advertising.
Client-side consent management
To implement consent mode for this tag using client-side consent management, set Automatically read from Tealium Consent Cookie to true in the tag configuration.
JavaScript Code extension
To map end-user consent choices to Microsoft consent mode settings, use the JavaScript Code extension. Configure the extension as follows:
- Set Scope to After Load Rules (default)
- Set Occurrence to Run Always
- Enter the JavaScript code for your CMP. You can customize the following code template for your CMP by replacing
CUSTOM_LOGICwith the logic for your vendor.
b.consent_decision = (tealiumConsentRegister && tealiumConsentRegister.currentDecision) || [];
b.microsoft_ad_storage_consent = CUSTOM_LOGIC ? 'granted' : 'denied';
For example, the following code is for OneTrust.
// After Load Rules - Run Always
b.consent_decision = (tealiumConsentRegister && tealiumConsentRegister.currentDecision) || [];
b.microsoft_ad_storage_consent = b.consent_decision.indexOf('C0004') !== -1 ? 'granted' : 'denied';
If you use these exact variable names, no additional mapping is required. The latest version of the tag uses these variables by default. Overwrite these variables by mapping the ad_storage parameter to attributes for your specific case.
Data mappings
Mapping is the process of sending data from a data layer variable to the corresponding destination variable of the vendor tag. For more information, see About data mappings.
The available categories are:
Standard
| Variable | Description |
|---|---|
tagid |
|
event_category |
|
event_action |
|
event_label |
|
event_value |
|
description |
|
fatal |
|
method |
|
screen_name |
|
search_term |
|
content_type |
|
content_id |
|
promotion_creative_name |
|
promotion_creative_slot |
|
promotion_id |
|
promotion_name |
|
enableAutoSpaTracking |
Enable automatic SPA tracking. |
id_sync_beacon |
ID sync beacon. |
customer_id |
Microsoft customer ID. |
visitor_id |
Visitor ID. |
user_id |
User ID. |
custom.myvar |
|
generate_event_id |
Boolean |
event_id |
String |
E-Commerce
| Variable | Description |
|---|---|
checkout_step |
|
checkout_option |
|
order_id |
|
order_subtotal |
|
order_shipping |
|
order_tax |
|
order_currency |
|
order_coupon_code |
|
product_id |
|
product_name |
|
product_brand |
|
product_category |
|
product_quantity |
|
product_unit_price |
|
| List of Product Creative Names |
|
| List of Product Creative Slots |
|
| List of Product Location IDs |
|
Events and engagements
Map to these destinations for triggering specific events on a page.
Use the following steps to trigger an event:
- Select an event from the list.
Choose from the predefined list, or create a custom event.
- For a custom event, enter a name with which to identify it.
- In the Trigger field, enter the value of the variable being mapped.
- To map more events, click the plus sign (+) and repeat Steps 1 and 2.
- Click Apply.
The event triggers when the value supplied is found in the data layer.
| Variable | Description |
|---|---|
add_payment_info |
|
add_to_cart |
|
add_to_wishlist |
|
begin_checkout |
|
checkout_progress |
|
exception |
|
generate_lead |
|
login |
|
page_view |
|
purchase |
|
refund |
|
remove_from_cart |
|
screen_view |
|
search |
|
select_content |
|
set_checkout_option |
|
share |
|
sign_up |
|
timing_complete |
|
view_item |
|
view_item_list |
|
view_promotion |
|
view_search_results |
|
update_consent |
|
custom |
|
Product audience events
Map to these destinations for triggering specific events on a page.
Use the following steps to trigger an event:
- Select an event from the list.
Choose from the predefined list, or create a custom event.
- For a custom event, enter a name with which to identify it.
- In the Trigger field, enter the value of the variable being mapped.
- To map more events, click the plus sign (+) and repeat Steps 1 and 2.
- Click Apply.
The event triggers when the value supplied is found in the data layer.
| Variable | Description |
|---|---|
retail |
|
travel |
|
hotel |
|
Enhanced conversion data
| Variable | Type/Values | Description |
|---|---|---|
em |
String |
Email. |
ph |
String |
Phone. |
Consent management
| Variable | Description |
|---|---|
ad_storage |
Ad storage. |
Event parameters
Map to these destinations if you want to pass additional data with events mapped earlier.
Parameters are only used with predefined events. To learn how to pass a parameter with a custom event, see Creating a Custom Event Specification.
Use the following steps to pass a parameter with a predefined event:
- Select an event from the list.
- Select a parameter from the list.
If using a custom parameter, enter a name with which to identify it. - Click Add.
| Variable | Description |
|---|---|
event_category |
|
event_action |
|
event_label |
|
event_value |
|
custom |
|
description |
|
fatal |
|
method |
|
screen_name |
|
search_term |
|
content_type |
|
content_id |
|
checkout_step |
|
checkout_option |
|
order_id |
|
order_total |
|
order_subtotal |
|
order_shipping |
|
order_tax |
|
order_currency |
|
order_coupon_code |
|
product_id |
|
product_name |
|
product_brand |
|
product_category |
|
product_quantity |
|
product_unit_price |
|
product_creative_name |
|
product_creative_slot |
|
promotion_creative_name |
|
promotion_creative_slot |
|
promotion_id |
|
promotion_name |
|
Product audience parameters
Map to these destinations if you want to pass additional data with events mapped earlier.
Parameters are only used with predefined events. To learn how to pass a parameter with a custom event, see Creating a Custom Event Specification.
Use the following steps to pass a parameter with a predefined event:
- Select an event from the list.
- Select a parameter from the list.
If using a custom parameter, enter a name with which to identify it. - Click Add.
| Variable | Description |
|---|---|
ecomm_prodid |
|
ecomm_pagetype |
|
ecomm_totalvalue |
|
ecomm_category |
|
travel_destid |
|
travel_originid |
|
travel_startdate |
|
travel_enddate |
|
travel_totalvalue |
|
hct_bpr |
|
hct_tpr |
|
hct_bid |
|
hct_cid |
|
hct_cod |
|
hct_los |
|
hct_pid |
|
hct_pagetype |
|
Product audience - Retail
| Variable | Description |
|---|---|
ecomm_prodid |
|
ecomm_pagetype |
|
ecomm_totalvalue |
|
ecomm_category |
|
Product audience - Travel
| Variable | Description |
|---|---|
travel_destid |
|
travel_originid |
|
travel_pagetype |
|
travel_startdate |
|
travel_enddate |
|
travel_totalvalue |
|
Product audience - Hotel
| Variable | Description |
|---|---|
hct_base_price |
|
hct_total_price |
|
hct_checkin_date |
|
hct_checkout_date |
|
hct_length_of_stay |
|
hct_partner_hotel_id |
|
hct_booking_ref |
|
hct_pagetype |
|
Vendor documentation
This page was last updated: December 3, 2025