It All Started With an Email…

Recently, we received an email from Microsoft Advertising with the subject line:

“Action Required – Adopt Consent Mode Immediately”

The email wasn’t just informational, it was a warning. Here’s what it said in summary:

“We are flagging your account as it appears you have not yet adopted Consent Mode. If you wish to continue using conversion-based strategies like MaxConversion or Target CPA, you must implement Consent Mode. Without it, your campaigns may suffer, especially in regions like the EEA, UK, and Switzerland.”

As someone who manages a WordPress website (built with Divi), this was my first time dealing with Microsoft Consent Mode. I knew about cookie banners and Google Tag Manager (GTM), but this was new territory. If you’re reading this and feel the same, don’t worry. This guide breaks everything down.

 

What Is Microsoft Consent Mode (in Simple Terms)?

Let’s start with the basics.

Consent Mode = Privacy-Aware Tracking

Microsoft Consent Mode is a privacy framework that makes sure your website respects the user’s consent before collecting or sending any tracking data to Microsoft Ads.

In even simpler terms:

It helps your ads only track people who said “Yes” to cookies — and stay legal in the process.

Think of it like this:

Microsoft, like Google, now requires this because of regulations like:

  • GDPR (Europe)

  • PECR (UK)

  • Swiss FADP (Switzerland)


Why It Matters (And Why You Should Care)

To be honest, most of us skip the legal stuff when setting up websites. I used to think:

“I just need a cookie banner and I’m done, right?”

Well… not exactly.

These laws don’t just want you to display a banner. They want you to:

  1. Group cookies by category (analytics, ads, essential)

  2. Wait for consent before firing non-essential scripts

  3. Let users change their preferences anytime

So if your UET (Microsoft tracking) script runs before someone clicks “Accept”, you’re in trouble.

That’s where Consent Mode and a CMP (Consent Management Platform) come in.


Meet the Tech: UET Tag, CMPs, and CookieYes


What is Microsoft UET Tag and Why Do You Need It?

UET stands for Universal Event Tracking.

It’s a tracking script provided by Microsoft Advertising that lets you monitor what people do on your website after clicking on one of your ads. It’s crucial for:

  • Tracking conversions (like purchases, sign-ups)

  • Building retargeting audiences

  • Using smart bidding strategies like MaxConversion or Target CPA

 But here’s the catch: you’re not allowed to drop the UET script (which uses cookies) unless the user consents. That’s where Consent Mode and CMPs come in.


What is a CMP (Consent Management Platform)?

A CMP is a tool that helps you ask visitors for cookie consent, show a cookie banner, and block tracking scripts until permission is granted.

In our case, we chose CookieYes, a CMP that’s even recommended by Microsoft. It has a free plan, is WordPress-friendly, and allows you to group cookies into categories like “advertising”, “analytics”, etc.

It also offers built-in support for Microsoft Consent Mode and integrates with Google Consent Mode too,  perfect if you run both ad platforms.


Step-by-Step: How We Implemented Microsoft Consent Mode with CookieYes


Step 1: Set Up a CookieYes Account

We created a free CookieYes account and got a script to embed in the <head> tag of our WordPress website. Since we use the Divi theme, we pasted it via Divi’s Theme Options > Integration > Add code to the <head> section.

Here’s what the script looks like:

<!–Load CookieYes consent manager –>

<script id=”cookieyes” type=”text/javascript”    src=”https://cdn-cookieyes.com/client_data/your-id/script.js“>
</script>


Step 2: Create a UET Tag in Microsoft Advertising

If you’re already running ads on Microsoft (formerly Bing Ads), you probably have access to the Microsoft Advertising dashboard. This is where you’ll create your UET (Universal Event Tracking) tag, which is essential for tracking user behavior, measuring conversions, and optimizing your campaigns.

Here’s how to do it:

  1. Log into your Microsoft Advertising account

     

  2. On the left-hand menu, hover over “Conversions”

     

  3. Click on “UET tag”

     

  4. In the “UET Tags” tab, click the + Create button.

     

  5. Give your tag a name (e.g., “Main Site UET Tag” or “CookieYes Integration”) and optionally a description so you can recognize it later.

     

  6. Once you hit Save, Microsoft will generate a UET tag script, copy that code snippet.
    You’ll need to add this to your site shortly (but don’t rush just yet — read on ).

Wait for the Tag to Become “Active”

Once you’ve created the tag, you’ll notice that its status initially shows as “Inactive.”

Don’t panic, this is expected.


Why You Need to Wait for the Tag to Become Active:
  • A UET tag only becomes “active” when Microsoft detects a successful firing of that tag from a real website visitor.

     

  • In other words, the tag must be loaded on a live webpage, and someone (you or a user) must visit the site, triggering the tag to send data to bat.bing.com (Microsoft’s tracking domain).

     

  • Until this happens, your tag will remain inactive, and you won’t be able to track conversions, audiences, or use remarketing features.

How to Activate It Quickly:

To manually trigger the tag and help Microsoft detect it:

  1. Paste the UET tag script into your website head tag

     

  2. Visit the site yourself (or ask a teammate to do so).

     

  3. Open your browser’s Network tab and check for requests to bat.bing.com.

     

  4. Go back to your Microsoft Ads dashboard after a few minutes, your UET tag should now show as “Active.”

Once the tag is active, you’re ready to continue with the rest of your setup, including integrating it with Consent Mode through CookieYes or a tag manager


This tag tracks user actions on your site, but again, we only want it to run
after consent is given.

Step 3: Customize the Cookie Consent Banner to Match Your Branding

Now that you’ve created your CookieYes account and added their script to your site, it’s time to focus on what your users will actually see, the cookie consent banner.

This banner is not just a legal or technical requirement, it’s a front-facing part of your website, and as such, it should blend seamlessly with your brand identity.

Think of it like this:

The cookie banner is the first thing many users will see when they land on your site. You don’t want it to feel like a pop-up from a different planet.


How to Customize the Cookie Banner in CookieYes:
  1. Log in to your CookieYes dashboard.

  2. At the top menu, click on “Cookie Banner.”

You’ll be taken to a full customization page, where you can tweak almost every detail of how your cookie banner looks and behaves.


Here are the main things you can customize:


Layout

Choose how the banner appears as a bar at the top, a box in the center, a footer notification, etc.

Content
Modify the actual text shown to your users. You can write your own consent message, update the button labels (e.g., “Accept”, “Reject”, “Customize”), and include your own privacy policy links.

Colors
Adjust the banner colors, background, button, and text, to match your brand’s color scheme. For instance, if your brand uses a deep blue with white text, you can make the banner feel like a native part of your site rather than a generic warning.


Custom CSS (Pro Feature)

If you’re on the paid plan, you can go further by adding custom CSS to fine-tune the appearance, perfect if you want pixel-perfect alignment or a totally unique style.


Why Should You Match the Banner to Your Branding?
  1. Consistency builds trust.
    A design that matches your branding looks intentional and professional. Users are more likely to feel confident accepting cookies from a site that looks trustworthy. 
  2. Better user experience.
    A cohesive look helps the consent process feel less intrusive. It reduces “banner blindness” and increases the chance of users engaging meaningfully with your message. 
  3. You’re in control of the tone.
    You can customize the messaging to make it friendlier, more formal, or more aligned with your audience tone — from playful startups to corporate enterprises.

Pro Tip:
Before finalizing your banner, preview it on both desktop and mobile to make sure it looks good across all screen sizes. You want the banner to be visible and functional, but not annoying or overwhelming.

Once you’re happy with how it looks, go ahead and publish the changes inside CookieYes. The updated banner will begin showing to your website visitors based on the rules you’ve configured.

 

Step 4: Enable Microsoft Consent Mode in CookieYes

In the CookieYes dashboard:

  1. Click Advanced Settings
  2. Scroll down to:
    •  Enable Microsoft UET Consent Mode
    •  Enable Microsoft Clarity Consent API integration (optional, for session recordings)

These options ensure that CookieYes can communicate user consent decisions directly to Microsoft services.


Step 5: Implement the Custom Script to Respect Cookie Consent

Once you’ve created your UET tag in Microsoft Advertising and added CookieYes to your site, the next step is to make the Microsoft UET tag wait until a user gives cookie consent.

This step is crucial for making your site privacy-compliant, especially under regulations like the GDPR or CCPA. It ensures that advertising or tracking scripts only load after users explicitly allow them.

Wait — Didn’t We Already Add the UET Script in the <head>?

Yes, you may have done that earlier, especially if you were trying to make sure the tag was “active” and sending data to Microsoft before setting up cookie consent.

But now it’s time to remove that UET script from your <head>.

Why? Because we’re about to re-add it in a controlled way, through a custom script that only runs after the user gives consent.


IMPORTANT: You’re Not Deleting the UET Tag—You’re Moving It

When setting up your Microsoft UET tag earlier (Step 2), you might have followed Microsoft’s instructions and pasted the UET script directly into your <head> tag. That’s totally normal, in fact, it was necessary to make sure the tag got registered and started sending basic signals to Microsoft.

But now, we need to move that exact same script into a new location, a custom script that checks if a user has given cookie consent first.

This doesn’t mean the UET script is old, outdated, or unnecessary.
Instead, we’re simply relocating it to make it load conditionally based on user consent.


Step-by-Step: What Goes Into the
<head> Tag 


1. Keep the CookieYes Script at the Top

This script loads the cookie banner and handles whether a user accepts or rejects different types of cookies:

<!– Load CookieYes consent manager –>

<script id=”cookieyes” type=”text/javascript” src=”https://cdn-cookieyes.com/client_data/your-id/script.js”></script>

Make sure this is always the first script in your <head> tag.


2. Remove the Standalone UET Script (So We Can Add It Back Correctly)

If you previously had something like this directly in your <head>:

<!– Microsoft UET Script –>

<script>

    (function(w,d,t,r,u){ 

        var f,n,i;

        w[u]=w[u]||[], 

        f=function(){

            var o={ti:”YOUR_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>

Go ahead and remove that from the <head>but only so we can add it again properly within a controlled script that checks user consent.

This is the exact same UET script, just repositioned and wrapped in a function so it only runs after consent is granted.


3. Add This Custom Script Just Below the CookieYes Script

Here’s the final working version that ties everything together:

<!– CookieYes Script –>

<script id=”cookieyes” type=”text/javascript” src=”https://cdn-cookieyes.com/client_data/your-id/script.js”></script>

<!– Custom Script to Initialize Microsoft UET Tag After Consent –>

<script>

    function initializeUET() {

        (function(w,d,t,r,u){

            var f,n,i;

            w[u]=w[u]||[],

            f=function(){

                var o={ti:”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”);

    }

    document.addEventListener(‘cookieyes_banner_load’, (eventData) => {

        const data = eventData.detail;

        // If user has already accepted advertising cookies

        if (data.categories.advertisement) {

            initializeUET();

        } else {

            // If not, wait until they update their preferences

            document.addEventListener(‘cookieyes_consent_update’, handleConsentUpdate);

        }

    });

    function handleConsentUpdate(eventData) {

        const data = eventData.detail;

        if (data.accepted.includes(“advertisement”)) {

            initializeUET();

        }

    }

</script>

Replace “YOUR_TAG_ID” with your real Microsoft UET tag ID from the Microsoft Ads dashboard.


Why All This Matters

  • You’re not losing or replacing the UET tag, you’re simply putting it in a smarter wrapper.

  • This ensures it doesn’t fire until the user agrees to advertising cookies.

  • That keeps your site compliant and improves user trust.


Final Summary: Your
<head> Tag Now Looks Like This


<!– Load CookieYes first –>

<script id=”cookieyes” type=”text/javascript” src=”https://cdn-cookieyes.com/client_data/your-id/script.js”></script>

<!– Then the custom UET script that waits for consent –>

<script>

    // … (custom code from above)

</script>

Everything is still happening in the <head> tag, just in a privacy-conscious order.


How Do I Know It’s Working?

After setting up Microsoft Consent Mode with CookieYes and your UET Tag, it’s important to confirm that everything is functioning as intended, especially that your tracking scripts are respecting user consent.

Here are several ways to test your setup, from using Microsoft tools to digging into your browser’s Developer Tools like a pro (don’t worry — it’s beginner-friendly!):


Option 1: Use Microsoft’s UET Tag Helper (Chrome Extension)

Search and Install the UET Tag Helper Chrome Extension. This tool helps you:

  • Detect if your UET tag is installed correctly

  • See if events (like page views or conversions) are being tracked

  • Check if data is being sent to Microsoft Ads

Important caveat:
This tool can sometimes cache values or show outdated statuses, especially if the page isn’t fully reloaded after consent is changed. It also might not reflect real-time updates accurately. So, while it’s helpful for basic checks, don’t rely on it alone.


Option 2: Check the Microsoft Ads Dashboard

After a few days, head to your Microsoft Advertising dashboard and:

  • Navigate to Conversion  > UET Tag

  • Verify that your tag is active

  • Confirm that conversions and audience sizes are updating

This helps ensure that real-world tracking is still occurring after users give consent.


Option 3: Use Incognito Mode for Clean Testing

Incognito mode gives you a clean slate without cached cookies or localStorage data.

  1. Open Chrome (or any modern browser)

  2. Open a new incognito window (Ctrl+Shift+N on Windows or Cmd+Shift+N on Mac)

  3. Visit your website

  4. When the cookie banner appears, click “Reject All”

  5. Press F12 (or right-click  >  Inspect) to open Developer Tools

  6. Go to the Network tab

  7. Reload the page

  8. In the filter/search bar, type bat.bing.com (Microsoft’s UET tracking domain)

What to expect:

  • If no requests are made to bat.bing.com, the tracking is being properly blocked

  • If a request is made and the query includes asc=D (consent denied), that’s also valid

  • If you see tracking requests without consent, something is wrong

Then:

  • Accept cookies via the banner

  • Reload the page

Check again — now you should see UET requests firing (e.g., requests to bat.bing.com) with consent granted (look for &c=G or similar)


Option 4: Use the Developer Tools – Network & Application Tabs

Now let’s go a little deeper for a manual check using built-in browser tools. You don’t need to be a developer to do this — here’s how to navigate it step-by-step:

Step 1: Open Developer Tools

In your Chrome browser:

  • Press F12
    OR

  • Right-click anywhere on the page and choose Inspect
    OR

  • Go to the Chrome menu  > More Tools  > Developer Tools

You’ll see a panel pop up, usually docked to the right or bottom of the screen.


Step 2: Check the Network Tab

  1. Inside Developer Tools, click the Network tab

  2. In the filter bar at the top, type: bat.bing.com

  3. Reload your website with the cookie banner active

  4. Click “Reject All” (or don’t accept cookies yet)


What to look for:

  • No tracking requests to bat.bing.com = Good

  • If any requests do fire, click on one and scroll down to the query string parameters

  • Look for asc=D in the request URL  > this means consent denied ( correct behavior)


Now:

  • Accept cookies

  • Reload the page again

  • Check again for new bat.bing.com requests

  • This time, look for asc=G or similar  > consent granted ( working correctly)


    If you don’t see a
    c= parameter at all, the UET tag may not be respecting Consent Mode, double-check your setup.

     

    Step 3: Check the Application Tab (For Stored Consent)

    1. In Developer Tools, go to the Application tab (you may need to expand the window or click the >> icon to find it)

    2. On the left sidebar, expand Cookies  > select your website’s domain

    3. Look for CookieYes-related cookies, such as:

      • cookieyes-consent

      • cookieyesID

      • Or any localStorage items with cookieyes or consent in the name

    What to look for:

    • When cookies are rejected, consent values like “D” (Denied) should appear

    • When cookies are accepted, values like “G” (Granted) or “A” (Accepted) should be set


      This verifies that the CMP is storing consent
      appropriately and legally — and that your site’s scripts are reacting based on that stored value.

       

      Bonus Tips & Troubleshooting

      • Always test in incognito mode for a clean slate

      • Remember that Consent Mode only works if you delay the UET tag until after consent

      • If the UET fires on every visit before clicking “Accept”, you might have placed the script outside of CookieYes control

      • Use Google Tag Manager (GTM) only if you’re comfortable, for beginners, hardcoding with CookieYes is safer and clearer

       

      Final Thoughts

      This process was a learning curve, especially since Microsoft’s instructions are not always beginner-friendly. But once you understand the why behind Consent Mode and how tools like UET and CookieYes work together, it becomes much easier to implement.

      If you’re a website owner or marketer using Microsoft Ads, this setup isn’t just recommended, it’s required. Ignoring it could impact your campaigns and even break privacy laws in some regions.