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 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 Sub Total
- 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
First, go to the Tealium tag marketplace and add the Microsoft Advertising Universal Event Tracking (UET) tag. For more information, see Manage Tags.
After adding the tag, configure the following settings:
- Tag ID: Your Microsoft Advertising tag identifier.
- Ad Storage Consent: Set the default consent for Ad Storage. Dynamically update this value by mapping the
ad_storage
parameter in the Data Mappings section. - Automatically read from Tealium Consent Cookie: If set to true, consent is set based on the Tealium Consent Manager.
Consent mode
There are two options to implement consent mode for this tag:
- Use Tealium 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.
Tealium Consent Management
To implement consent mode for this tag using Tealium 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_LOGIC
with 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 instructions on how to map a variable to a tag destination, see 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 |
|
custom.myvar |
|
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 drop-down 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 |
|
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 drop-down 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 |
|
Event Parameters
Map to these destination if you wish 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 drop-down list.
- Select a parameter from the drop-down 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 destination if you wish 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 drop-down list.
- Select a parameter from the drop-down 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: October 16, 2024