
Here at Scommerce Mage, we know that driving traffic and conversions is the lifeblood of your Magento 2 store. While you’ve likely spent weeks optimizing for Google, .it’s easy to overlook a critical revenue stream: Microsoft Advertising. That’s why setting up Microsoft Bing Consent Mode on Magento 2 is essential.
But in today’s privacy-focused world, simply having the Bing UET tag on your site isn’t enough. Without a proper consent mode implementation, you’re flying blind. When users decline cookies, you lose valuable conversion data, your remarketing audiences shrink, and your Bing Ads ROAS suffers.
The problem? Most guides are generic. They don’t account for sophisticated, integrated solutions like your Magento 2 store.
That’s where we come in.
This definitive guide will show you how to seamlessly integrate our Scommerce Mage GDPR and GTM Module with Microsoft Bing Consent Mode using Google Tag Manager. We’ll bypass the standard, inflexible setups and build a robust solution that sends the right signals to Bing, every single time.
Why Microsoft Bing Consent Mode is Crucial
With global privacy laws like GDPR, ePrivacy, and CCPA tightening the way user data is captured and processed, ensuring true cookie consent compliance is now essential—not optional. While platforms such as Google have established Consent Mode, Microsoft Advertising (Bing Ads) has introduced a similar mechanism called Microsoft UET Consent Mode.
This gives you the power to:
- Respect user privacy preferences
- Still track conversions compliantly
- Avoid data loss that impacts ROAS and remarketing
Goal: Ensure Microsoft Bing’s tracking respects cookie consent choices set by the user using our Magento 2 GDPR & Cookie Popup extension—without needing a third-party CMP!
Prerequisites
Before we start, you’ll need:
- The Scommerce Mage GDPR and GTM Extension installed and configured on your Magento 2 store.
- Your Microsoft Advertising UET Tag ID.
- A working Google Tag Manager (GTM) container installed on your site.
The Technical Magic: How Our Module Works with GTM
Our GDPR module is engineered to communicate directly with Google Tag Manager. When a user interacts with the cookie banner on your site, our extension automatically pushes a clean, structured event to the dataLayer
. This event, named user_consent_set
, contains the user’s precise choices.
{
event: "user_consent_set",
gtm: {uniqueEventId: 4},
ad_storage: "denied",
ad_user_data: "granted",
ad_personalization: "granted",
analytics_storage: "granted",
consent_timestamp: "2025-07-10T14:38:54.735Z"
}
This is the key that unlocks a truly custom and reliable implementation.
Step 1: The First Step to Microsoft Bing Consent Mode on Magento 2
The standard Microsoft UET tag in GTM lacks the granular control we need. We’ll use a powerful community template instead.
- In your GTM container, go to Templates > Tag Templates > Search Gallery.
- Search for
Microsoft UET Consent Mode
. Select the one by mbaersch. - Click Add to workspace and approve the permissions.
Template:- https://github.com/mbaersch/microsoft-consent-mode-tag
Step 2: Configure the “Default” Consent State
First, we set a default, “denied” state that fires on every page load before a user interacts with our cookie banner.
- Navigate to Tags > New.
- Name the tag
Microsoft Consent - Default
. - For Tag Configuration, choose the Microsoft UET Consent Mode template.
- Consent Command: Set this to
Default
. - Wait for Update: Set this to 1
5000
(milliseconds). This gives the user 15 seconds to interact with the banner before the defaultdenied
signal is sent, preventing data loss. - ad_storage Status: Set it to Denied. This ensures you are compliant by default.
- Triggering: Select the Consent Initialization – All Pages trigger. This is crucial for firing the tag at the earliest possible moment.
- Click Save.

Step 3: Create GTM Variables to Read Our Module’s Data
Now, we need GTM to listen for the consent choices sent by the Scommerce Mage GDPR module.
- Go to Variables > User-Defined Variables > New.
- Select Data Layer Variable.
- Data Layer Variable Name:
ad_storage
(must match the key in thedataLayer
push). - Name your GTM variable
ad_storage
.

- Save and check whether your variable is collecting the value correctly

Step 4: Create the Trigger to Fire on User Choice
We need a trigger that fires only when our GDPR module pushes the user_consent_set
event.
- Go to Triggers > New.
- Name the trigger
Event - user_consent_set
. - For Trigger Configuration, choose Custom Event.
- Event name:
user_consent_set
. - Click Save.

Step 5: Configure the “Update” Consent State
This tag will send the user’s actual choices to Microsoft, overriding the default.
- Go to Tags > New.
- Name the tag
Microsoft Consent - Update
. - Choose the Microsoft UET Consent Mode template.
- Consent Command: Set this to
Update
. - Ad Storage Status: Click the variable icon (the lego brick) and select your
{{ad_storage}}
variable. - Triggering: Select the
Event - user_consent_set
trigger you just created. - Save the tag.

Step 6: Update Your Main Microsoft UET Tag
Finally, we tell your main Bing tag to listen to these new consent signals.
- Find your existing Microsoft Advertising UET Tag in GTM.
- Click to edit it, then expand the Consent Settings(Experimental) section.
- clear the checkboxes for “Enable Consent updates from GTM” and “Inherit Initial Consent from GTM”. This is a critical step that hands over full control to our manual
Default
andUpdate
tags. - Ensure its trigger is set to Initialization – All Pages.
- Save the tag.

Verification: Confirming Your Microsoft Bing Consent Mode on Magento 2 Setup
You don’t have to guess if it’s working. You can prove it.
- Enter GTM Preview Mode and navigate to your Magento 2 store.
- Open your browser’s Developer Tools (F12 or Cmd+Opt+I) and go to the Network tab. Filter the requests by typing
bat.bing.com
. - Before clicking the cookie banner: You will see a
bat.bing.com
request. Click it. In the request URL (under Headers), look for theasc
parameter. It will beasc=f
(false). This is your Default state working perfectly.https://bat.bing.com/action/0?ti=...&Ver=2&mid=...&asc=D...

- Now, accept cookies using the Scommerce Mage banner.
- A new
bat.bing.com
request will fire. Inspect this new one. Theasc
parameter will now beasc=t
(true). You will also see Microsoft cookies (_MUID
,_MUIDB
) being set in the Application tab. This is your Update state working perfectly.https://bat.bing.com/action/0?ti=...&Ver=2&mid=...&asc=G...

Take Control of Your Microsoft Bing Ads Data Today
By pairing the Scommerce Mage GDPR and GTM module with this GTM configuration, you’ve built a best-in-class consent solution for your Magento 2 store. You’re now fully compliant, capturing more valuable data, and empowering Microsoft’s algorithms to get you the best possible return on your ad spend.
This entire set up is included with our GTM module and you can directly use the setup using the import file provided with the module. Ready to unlock accurate Bing Ads tracking on your Magento 2 store?