Bing Consent Mode on WordPress with PixelYourSite

If you run Bing Ads and serve any EU traffic, Microsoft requires you to use Bing Consent Mode (UET Consent Mode). PixelYourSite implements it, ConsentMagic drives it. Other consent plugins can use a filter PYS exposes.

Get expert tracking tips in your inbox

Join 65,000+ marketers and site owners who already get our best guides on Meta Pixels, CAPI, GA4, Google Ads, TikTok & Pinterest tracking, GDPR, and more.

* We don’t spam, and all our emails have an “Unsubscribe” link that works. 

What Bing Consent Mode is

When the Microsoft UET (Universal Event Tracking) tag fires, it sends a consent parameter that tells Microsoft whether the visitor agreed to advertising cookies. Two values, two outcomes:

  • denied — the tag fires but doesn’t drop advertising cookies, doesn’t track conversions for remarketing, doesn’t build retargeting audiences from this visitor.
  • granted — the tag behaves normally: cookies, conversions, audiences, everything.

In code, the UET tag is set with a default consent state right after it loads, and updated when the visitor changes their mind:

html

<script>
window.uetq = window.uetq || [];
window.uetq.push('consent', 'default', { 'ad_storage': 'denied' });
</script>

When the visitor accepts:

html

<script>
window.uetq = window.uetq || [];
window.uetq.push('consent', 'update', { 'ad_storage': 'granted' });
</script>

For EU traffic under GDPR, the default state must be denied and only flip to granted after the visitor’s explicit opt-in. PixelYourSite handles the UET tag injection and the consent signal. You only need to decide which consent plugin drives the opt-in.

Three setup paths

SetupBing tagConsent pluginWhen to use
RecommendedPYS Bing add-onConsentMagicNew install, or you want the cleanest path. Native integration, no configuration glue.
Alternative 1PYS Bing add-onAny other consent plugin that supports filtersYou’re committed to a different consent tool (Cookiebot, Complianz, Iubenda, etc.). Use the PYS filter pys_disable_bing_by_gdpr to tell PYS the visitor’s state.
Alternative 2PYS Bing add-onNone, or a consent plugin that blocks scripts upstreamYour consent plugin blocks the Bing tag entirely until consent is given. PYS sends granted on every fire, because the tag only runs when consent is already there.

Recommended: PixelYourSite + ConsentMagic

  1. Install the Bing add-on for PixelYourSite Pro. Add your UET Tag ID in PixelYourSite Pro → Bing.
  2. Install ConsentMagic and configure the banner. Default rule for the EU region: ask first, deny by default.
  3. That’s it. ConsentMagic writes the Bing consent state via PYS’s native integration (cs_bing_consent_mode.ad_storage). The UET tag fires on every page with the correct consent value automatically.

Alternative 1: PixelYourSite + another consent plugin

PYS exposes a developer filter, pys_disable_bing_by_gdpr, that any consent plugin can hook into. When the filter returns true, PYS sets Bing Consent Mode to denied. When it returns false (the default), PYS sets it to granted.

For Cookiebot specifically, PYS includes a built-in mapping. In PixelYourSite Pro → GDPR there’s a field Bing consent category (default value marketing) that ties the Bing consent state to the category Cookiebot uses for marketing.

For other plugins (Complianz, Iubenda, OneTrust, custom), hand the developer this filter and the category name they should map to:

php

add_filter( 'pys_disable_bing_by_gdpr', function( $disabled ) {
    // return true if the visitor hasn't granted marketing consent
    return ! my_consent_plugin_has_marketing_consent();
} );

Alternative 2: Fire Bing tags with consent already granted

For sites where the consent plugin blocks the UET tag from loading at all until consent is given, PYS doesn’t need to send denied. In PixelYourSite Pro → Bing settings, enable Fire Bing tags with consent mode granted. PYS sends granted on every fire, because if the script ran, consent must already be there.

This is the right path when:

  • Your consent plugin uses script blocking (the Bing tag literally doesn’t execute pre-consent).
  • Your traffic isn’t subject to GDPR and you don’t want a consent banner at all.

It’s the wrong path when the Bing tag fires before consent is given. In that case the visitor gets tracked as granted without their actual opt-in, which is a GDPR violation.

Verify it’s working

Install the Bing Pixel Helper Chrome extension.

  1. Open your site in an incognito window so no prior consent is cached.
  2. Open the Bing Pixel Helper. Go to Events. Click Parameter details on any reported event.
  3. Find the asc parameter.
    • D = Denied.
    • G = Granted.
  4. Accept ad/data consent in your banner.
  5. Reload. The asc value should flip from D to G.

If asc is D after you accepted consent, your consent plugin isn’t telling PYS about the change. If it’s G before you accepted, your default state is wrong.

Things to know

  • GDPR isn’t the only consent regime. UK GDPR, Switzerland’s revFADP, Brazil’s LGPD, and several US state laws (CCPA / CPRA, Virginia, Colorado) follow similar logic. Use Consent Mode for any region with explicit opt-in requirements; check with legal counsel about which regions apply to your traffic.
  • Bing Consent Mode is per-visit. A visitor who declines on day one, returns and accepts on day five, will start counting toward conversions from day five. Earlier visits aren’t retroactively granted.
  • No conversion attribution without consent. A visitor who never accepts ad cookies won’t appear in Bing Ads conversion reports for that visit, even if they purchased. The UET tag still fires, but Microsoft doesn’t tie the conversion to the click.
  • Don’t double-block. If your consent plugin both blocks the UET script upstream AND PYS sends denied, the tag runs zero times. Use one mechanism at a time. The Recommended setup uses ConsentMagic’s signal, not script blocking, so the UET tag fires on every page with the consent state attached.
  • Bing modeled conversions. Microsoft uses modelling to estimate conversions lost to declined consent. Coverage depends on data volume; small advertisers see less.

Don’t stop here!

Subscribe to get more tips on tracking, analytics, and GDPR.

We’ll send you practical guides on Meta Pixel, CAPI, GA4, Google Ads, TikTok, Pinterest, GDPR compliance, and more, right to your inbox.

* We don’t spam, and all our emails have an “Unsubscribe” link that works. 

Track 404 Errors in GA4 with PixelYourSite

When a visitor hits a URL that doesn’t exist, your server returns a 404. PixelYourSite logs each one to GA4 with the broken URL and the referrer attached, so you can fix dead links before they cost sales, rank, or ad spend.

Find out when we have the next BIG OFFER!

Over 70 000 business-owners have access to our BIG DISCOUNTS. Don't miss the next one: