Microsoft UET (Universal Event Tracking) tags are essential for verifying your WooCommerce store and tracking performance in Microsoft Ads. This guide walks you through safely adding the UET tag using a plugin — no coding required.
Prerequisites
Before you begin:
-
You’ve connected your Microsoft Ads account.
-
You’ve created a UET tag using the “Create UET Tag” button in the setup flow.
-
You have admin access to your WordPress site.
Step 1: Copy Your UET Tag Code
-
In the UET Tag & Tracking Setup step, locate the Manual UET Tag Installation section.
-
Click the Copy button to copy the full UET tag script.
Option A: Use a Plugin (Recommended)
Step A1: Install a Header Script Plugin
-
In your WordPress admin, go to
Plugins > Add New -
Search for:
Insert Headers and Footers by WPCode -
Click Install Now, then Activate
Step A2: Add Your UET Tag Script
-
Go to Code Snippets > Header & Footer
(or Settings > Insert Headers and Footers) -
Paste your entire UET script into the Header section.
Click Save Changes from the bottom
Option B: Add Code Manually (Advanced Users)
⚠️ Only use this method if you’re familiar with editing theme files.
Step B1: Open the Theme Editor
-
Go to Appearance > Theme File Editor
-
Select your active theme
-
In the file list, open
header.php
Step B2: Locate the </head>
Tag
-
Use CTRL + F (Windows) or CMD + F (Mac) to search for
</head>
-
This is the closing head tag — you must paste your script right above it
Step B3: Paste Your UET Tag Script
-
On the line directly above
</head>
, paste the copied UET tag script -
Add a blank line if needed, but do not remove any existing code
Example:
Edit<!-- Microsoft UET Tag -->
<script>...your copied script here...</script>
</head> -
Click Update File to save your changes
Final Checks
🔍 Double-check:
-
You pasted the script above
</head>
, not inside or below it. -
The script starts with
<script>
and ends with</script>
-
No other code was accidentally removed or altered
🛑 If something breaks, use the "Restore previous version" link at the top of the editor or restore your theme from a backup
Need Help?
Reach out to our support team if:
-
You’re unsure where to paste the code
-
You want help tracking purchases or events
-
The tag isn’t firing correctly after saving