How to Add Microsoft UET Tag to Your WooCommerce Store

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.Screenshot 2025-06-29 at 4.50.51 PM

  • You have admin access to your WordPress site.

Step 1: Copy Your UET Tag Code

  1. In the UET Tag & Tracking Setup step, locate the Manual UET Tag Installation section.

  2. Click the Copy button to copy the full UET tag script.Screenshot 2025-06-29 at 4.58.10 PM

Option A: Use a Plugin (Recommended)

Step A1: Install a Header Script Plugin

  1. In your WordPress admin, go to
    Plugins > Add New

  2. Search for:
    Insert Headers and Footers by WPCode 

  3. Click Install Now, then Activate


Step A2: Add Your UET Tag Script

  1. Go to Code Snippets > Header & Footer
    (or Settings > Insert Headers and Footers)

  2. Paste your entire UET script into the Header section.Screenshot 2025-06-29 at 5.45.28 PM
    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

  1. Go to Appearance > Theme File Editor

  2. Select your active theme

  3. In the file list, open header.php


Step B2: Locate the </head> Tag

  1. Use CTRL + F (Windows) or CMD + F (Mac) to search for </head>

  2. This is the closing head tag — you must paste your script right above it


Step B3: Paste Your UET Tag Script

  1. On the line directly above </head>, paste the copied UET tag script

  2. 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>
  3. 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