Microsoft Advertising Event Tracking
Overview
Microsoft Advertising (formerly Bing Ads) uses Universal Event Tracking (UET) tags to measure conversions and user behavior across Bing, Yahoo, AOL, and Microsoft Audience Network. UET provides conversion tracking, remarketing capabilities, and automated bidding optimization. Microsoft Advertising also supports offline conversion imports and enhanced conversions for improved attribution.
Standard Events
Microsoft Advertising UET supports predefined event types and custom events:
Commerce Events
- Purchase - Completed transaction with revenue
- Add to cart - Product added to shopping cart
- Add to wishlist - Product saved for later
- Begin checkout - Checkout process initiated
Lead Generation Events
- Contact - Form submission or contact request
- Submit application - Application completed
- Request quote - Quote or estimate requested
- Sign up - Account registration or newsletter signup
- Download - File, whitepaper, or app download
- Book appointment - Appointment or demo scheduled
Engagement Events
- Page view - Specific page visit
- Video complete - Video watched to completion
- Find location - Store locator used
- Subscribe - Subscription started
Standard Conversion Actions
Create conversion goals without custom events:
- Destination URL - Visit to specific page (e.g., thank you page)
- Duration - Time spent on site
- Pages/visit - Number of pages viewed
- Event - Custom UET event fired
Custom Events
Creating Custom Events
Track business-specific actions with custom UET events:
// Basic custom event
window.uetq = window.uetq || [];
window.uetq.push('event', 'custom_event_name', {
'event_category': 'category',
'event_label': 'label',
'event_value': 25.00
});
Event Implementation Examples
// Lead submission
window.uetq.push('event', 'contact', {
'event_category': 'lead_generation',
'event_label': 'contact_form',
'event_value': 50.00 // Lead value
});
// Product view
window.uetq.push('event', 'view_item', {
'event_category': 'product_interaction',
'event_label': 'product_SKU_123',
'revenue_value': 99.99,
'currency': 'USD'
});
// Video completion
window.uetq.push('event', 'video_complete', {
'event_category': 'engagement',
'event_label': 'product_demo_video'
});
Variable Revenue Tracking
Track dynamic revenue values:
// Variable revenue event
window.uetq.push('event', '', {
'revenue_value': parseFloat(orderTotal),
'currency': 'USD'
});
Event Parameters
Available parameters for UET events:
- event_category - Grouping for similar events
- event_label - Specific identifier or details
- event_value - Numeric value (non-revenue)
- revenue_value - Transaction revenue
- currency - 3-letter ISO currency code (USD, EUR, GBP, etc.)
- transaction_id - Unique order identifier for deduplication
Ecommerce Events
Purchase Tracking
Comprehensive ecommerce conversion tracking:
<!-- UET Base Tag (on all pages) -->
<script>
(function(w,d,t,r,u){
var f,n,i;
w[u]=w[u]||[],f=function(){
var o={ti:"TAG_ID"};
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>
<!-- Purchase Event (on confirmation page) -->
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', 'purchase', {
'revenue_value': 149.99,
'currency': 'USD',
'transaction_id': 'ORDER_12345',
'event_category': 'ecommerce',
'items': 'SKU_123,SKU_456' // Optional product IDs
});
</script>
Shopping Cart Events
Track the complete purchase funnel:
// Add to Cart
window.uetq.push('event', 'add_to_cart', {
'event_category': 'ecommerce',
'event_label': 'SKU_123',
'revenue_value': 99.99,
'currency': 'USD'
});
// Begin Checkout
window.uetq.push('event', 'begin_checkout', {
'event_category': 'ecommerce',
'revenue_value': 149.99,
'currency': 'USD'
});
// Purchase
window.uetq.push('event', 'purchase', {
'revenue_value': 149.99,
'currency': 'USD',
'transaction_id': 'ORDER_12345'
});
Microsoft Shopping Campaigns
For Microsoft Shopping ads, ensure proper product tracking:
window.uetq.push('event', 'purchase', {
'revenue_value': 99.99,
'currency': 'USD',
'transaction_id': 'TXN_67890',
'items': [
{
'id': 'SKU_001',
'quantity': 1,
'price': 99.99
}
]
});
Conversion Tracking
Implementation Methods
1. UET Tag (JavaScript)
Standard UET tag implementation:
<!-- Step 1: Install UET tag on all pages -->
<script>
(function(w,d,t,r,u){
var f,n,i;
w[u]=w[u]||[],f=function(){
var o={ti:"YOUR_TAG_ID", // Replace with 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>
<!-- Step 2: Add conversion events on conversion pages -->
<script>
window.uetq.push('event', 'purchase', {
'revenue_value': 99.99,
'currency': 'USD'
});
</script>
2. Google Tag Manager
Deploy UET via GTM:
Base Tag:
Event Tracking:
// GTM Custom HTML Tag for events
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', 'purchase', {
'revenue_value': {{Transaction Value}},
'currency': 'USD',
'transaction_id': {{Transaction ID}}
});
</script>
3. Conversion Goals
Create conversion goals in Microsoft Advertising:
Goal Types:
- Destination URL - Conversion when URL is visited
- Duration - Conversion based on time on site
- Pages per visit - Conversion based on page depth
- Event - Conversion when UET event fires
Creating Event-Based Goal:
- Navigate to Tools > Conversion Goals
- Select Event goal type
- Configure:
- Event action (e.g., "purchase")
- Event category (optional)
- Event label (optional)
- Value (fixed or variable)
- Conversion window
4. Enhanced Conversions
Improve conversion attribution with first-party data:
// Enhanced conversion with user data
window.uetq = window.uetq || [];
window.uetq.push('set', {
'pid': {
'em': 'user@example.com', // Will be hashed
'ph': '15551234567',
'fn': 'John',
'ln': 'Doe',
'ct': 'New York',
'st': 'NY',
'zp': '10001',
'country': 'US'
}
});
window.uetq.push('event', 'purchase', {
'revenue_value': 99.99,
'currency': 'USD',
'transaction_id': 'ORDER_12345'
});
Single Page Applications
Enable automatic SPA tracking:
var uetq = window.uetq || [];
window.uetq = new UET({
ti: "YOUR_TAG_ID",
enableAutoSpaTracking: true // Enable SPA tracking
});
window.uetq.push("pageLoad");
// Manual virtual page view
window.uetq.push('event', 'page_view', {
'page_path': '/virtual-page'
});
Offline Conversions
Import Methods
1. Manual Upload via UI
Upload offline conversions through Microsoft Advertising UI:
CSV File Requirements:
- Microsoft Click ID (MSCLKID) - Click identifier from URL parameter
- Conversion Name - Must match existing conversion goal
- Conversion Time - When conversion occurred
- Conversion Value - Revenue (optional)
- Conversion Currency - Currency code (optional)
CSV Format:
MicrosoftClickId,ConversionName,ConversionTime,ConversionValue,ConversionCurrency
abc123def456,Purchase,2025-01-15 10:30:00,99.99,USD
xyz789ghi012,Lead,2025-01-15 14:20:00,25.00,USD
Upload Steps:
- Navigate to Tools > Conversions > Offline conversion goals
- Create offline conversion goal
- Upload CSV file
- Map columns to required fields
- Review and complete import
2. Microsoft Advertising API
Automate offline conversion uploads:
from bingads.v13.bulk import *
from bingads.service_client import ServiceClient
from bingads.authorization import *
# Authenticate
authorization_data = AuthorizationData(
account_id='YOUR_ACCOUNT_ID',
customer_id='YOUR_CUSTOMER_ID',
developer_token='YOUR_DEVELOPER_TOKEN',
authentication=OAuthWebAuthCodeGrant(
client_id='YOUR_CLIENT_ID'
)
)
# Upload offline conversions
conversion_upload_service = ServiceClient(
service='CampaignManagementService',
version=13,
authorization_data=authorization_data
)
offline_conversions = {
'OfflineConversions': [
{
'MicrosoftClickId': 'abc123def456',
'ConversionName': 'Purchase',
'ConversionTime': '2025-01-15T10:30:00',
'ConversionValue': 99.99,
'ConversionCurrency': 'USD'
}
]
}
response = conversion_upload_service.ApplyOfflineConversions(
OfflineConversions=offline_conversions
)
3. Click ID Capture
Capture MSCLKID for offline conversion attribution:
// Capture MSCLKID from URL
function getMSCLKID() {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get('msclkid');
}
// Store in form or session
const msclkid = getMSCLKID();
if (msclkid) {
// Store in hidden form field
document.getElementById('msclkid_field').value = msclkid;
// Or store in localStorage/cookie
localStorage.setItem('msclkid', msclkid);
}
4. CRM Integration
Connect CRM for automated offline conversion tracking:
Supported Integrations:
- Salesforce
- Microsoft Dynamics 365
- Custom API integration
Implementation:
- Enable auto-tagging in Microsoft Advertising
- Capture MSCLKID in CRM records
- Export conversions from CRM with MSCLKID
- Upload via API or manual import
Attribution
Attribution Models
Microsoft Advertising supports multiple attribution models:
Last Click (Default)
- 100% credit to last clicked ad
- Most common for direct response campaigns
First Click
- 100% credit to first interaction
- Useful for awareness campaigns
Linear
- Equal credit across all clicks in conversion path
- Balanced view of customer journey
Time Decay
- More recent clicks receive more credit
- Good for longer sales cycles
Position Based
- 40% to first click, 40% to last click, 20% to middle clicks
- Balances acquisition and conversion
Configure: Tools > Conversion Goals > Attribution Settings
Conversion Windows
Set lookback periods for conversions:
- Click conversion window: 7, 30, or 90 days (default: 30)
- View conversion window: 1, 7, or 30 days (default: 1)
Configure per conversion goal in goal settings.
Cross-Device Conversions
Track conversions across devices:
- User clicks ad on mobile
- User converts on desktop
- Both counted in conversion path
Enabled automatically for signed-in Microsoft users.
Assisted Conversions
View conversions that had multiple touchpoints:
Navigate to Reports > Attribution > Assisted Conversions to see:
- Keywords that assisted conversions
- Campaigns with indirect impact
- Time lag between first click and conversion
Debugging & Validation
UET Tag Helper
Browser extension for validating UET implementation:
- Install UET Tag Helper Chrome extension
- Visit page with UET tag
- View tag status:
- Tag ID detected
- Events fired
- Parameters passed
- Errors and warnings
Tag Status in UI
Check UET tag health in Microsoft Advertising:
Navigate to Tools > UET Tags
Review Tag Status column:
- Verified - Tag firing correctly
- Unverified - Tag not detected
- Inactive - Tag not installed
Click View Details for:
- Recent page loads
- Events tracked
- Configuration issues
Conversion Goal Tracking Status
Verify conversion goals are recording:
Tools > Conversion Goals > Tracking Status:
- Recording - Conversions tracked successfully
- No recent conversions - Goal created but no conversions yet
- Unverified - UET tag not detected
Test Conversions
Generate test conversions to verify setup:
- Ensure UET tag is installed
- Click your own ad (or use test account)
- Complete conversion action
- Wait 1-2 hours
- Check All Campaigns > Columns > Conversions
Note: Conversions may take up to 24 hours to appear in reporting.
Debug Console
Use browser console to verify UET events:
// Check UET queue
console.log(window.uetq);
// Verify tag loaded
if (typeof UET !== 'undefined') {
console.log('UET tag loaded successfully');
} else {
console.error('UET tag not found');
}
Common Issues
Tag not detected:
- Verify Tag ID is correct
- Check script placement in <head> section
- Ensure no JavaScript errors blocking execution
- Clear browser cache and test again
Events not tracking:
- Verify event name matches conversion goal
- Check event fires after UET tag initialization
- Confirm page remains loaded long enough for event to send
- Review UET Tag Helper for event confirmation
Conversions not appearing:
- Check conversion window settings
- Verify user clicked Microsoft ad before converting
- Ensure conversion goal is active
- Wait up to 24 hours for reporting delay
Best Practices
Implementation
- Install UET tag on all pages for complete user journey tracking
- Use Google Tag Manager for easier tag management
- Enable auto-tagging to capture MSCLKID automatically
- Implement enhanced conversions for improved attribution
- Enable SPA tracking for single-page applications
Conversion Strategy
- Create multiple conversion goals for different actions
- Set appropriate conversion values reflecting business worth
- Use event-based goals for flexible tracking
- Track micro-conversions (add to cart, sign up) for remarketing
- Configure primary conversions for automated bidding
Data Quality
- Use transaction_id to prevent duplicate purchase conversions
- Pass revenue_value for all ecommerce events
- Include currency code for international campaigns
- Implement enhanced conversions for better match rates
- Regular audit of UET tag functionality
Attribution
- Choose attribution model matching business model
- Set conversion windows based on typical sales cycle
- Review assisted conversions to understand full funnel
- Use time lag reports to optimize bidding strategies
- Enable cross-device tracking for complete attribution
Privacy & Compliance
- Respect user consent for GDPR/CCPA compliance
- Implement consent management platform if required
- Hash PII before sending (automatic with enhanced conversions)
- Update privacy policy to disclose Microsoft Advertising tracking
- Honor opt-out requests via Microsoft's privacy controls
Optimization
- Use conversion-based bidding (Target CPA, Maximize Conversions)
- Exclude converted users from acquisition campaigns
- Create conversion-based audiences for remarketing
- Import offline conversions within 90 days
- Review conversion reports weekly for optimization insights
Testing
- Test UET tag with UET Tag Helper before launch
- Verify conversion goals fire correctly on test conversions
- Check all event parameters pass accurate data
- Test across browsers and devices
- Monitor tag status daily for first week after implementation
Reporting
- Add conversion columns to campaign reports
- Segment by device to understand conversion patterns
- Use conversion funnel reports to identify drop-off points
- Review time lag reports to optimize conversion windows
- Export offline conversions for external analysis
Shopping Campaigns
- Track all ecommerce events for Shopping optimization
- Pass product IDs in conversion events
- Use variable revenue tracking for accurate ROAS
- Implement cart abandonment events for remarketing
- Monitor product performance by conversion metrics