How to Add Microsoft UET Tag to Your Shopify Store

Universal Event Tracking (UET) lets you track user actions on your website and measure campaign performance in Microsoft Advertising. Follow these steps to add your UET tag to your Shopify store.

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 can access your Shopify theme code.Screenshot 2025-06-29 at 4.54.39 PM

Step 1: Copy Your UET Tag Code

  1. In the UET Tag & tracking setup step of your setup flow, locate the JavaScript snippet under “Manual UET Tag Installation.”

  2. Click the Copy button to copy the full UET script.

    Screenshot 2025-06-29 at 4.58.10 PM

Step 2: Add the UET Tag to Your Shopify Theme

  1. Log into your Shopify admin panel.

  2. Go to Online Store > Themes.

  3. Click Actions > Edit code for your active theme.
    Screenshot 2025-06-29 at 4.54.39 PM

  4. Under the Layout folder, select theme.liquid.
    Screenshot 2025-06-29 at 5.00.44 PM

    Step 3: Find the Closing </head> Tag

    1. Use CMD + F (Mac) or CTRL + F (Windows) to open the search bar.

    2. Type </head> (be sure to include the forward slash /).

      ⚠️ Don't search for <head> — that's the opening tag. You must add your script before the closing </head> tag.

     Step 4: Paste the UET Tag Code

    1. Locate the </head> tag.

    2. On the line immediately above </head>, paste the entire UET tag script you copied earlier.Screenshot 2025-06-29 at 5.08.07 PM

    3. If there's already code above </head>, hit Enter to create a new empty line and paste your tag there — do not overwrite or delete existing code.

Final Checks Before Saving

🔍 Double-Check:

  • You added the script above </head>, not inside or below it.

  • You did not delete or alter any existing code or brackets (<, >, {, }).

  • The pasted script starts with <script> and ends with </script>.

Save Your Changes:

  • Click Save at the top right.Screenshot 2025-06-29 at 5.13.09 PM

Need Help?

Reach out to our support team if:

  • You're unsure where to paste the code.

  • You want help with advanced conversion tracking.

  • You see an error after saving.