Skip to content

Latest commit

 

History

History
76 lines (59 loc) · 1.67 KB

File metadata and controls

76 lines (59 loc) · 1.67 KB
title Bing UET
description Use Microsoft Advertising Universal Event Tracking in your Nuxt app.
links

Microsoft Advertising UET (Universal Event Tracking) lets you track conversions, build remarketing lists, and optimize your Microsoft Advertising campaigns.

Nuxt Scripts provides a registry script composable useScriptBingUet(){lang="ts"} to easily integrate Bing UET in your Nuxt app.

::script-stats ::

::script-docs ::

::script-types ::

Examples

Tracking Conversions

<script setup lang="ts">
const { proxy } = useScriptBingUet()

function trackPurchase() {
  proxy.uetq.push({
    ec: 'purchase',
    ev: 49.99,
    gc: 'USD',
  })
}
</script>

Custom Events

<script setup lang="ts">
const { proxy } = useScriptBingUet()

function trackSignup() {
  proxy.uetq.push({
    ec: 'sign_up',
    el: 'newsletter',
    ea: 'engagement',
  })
}
</script>

Consent Mode

Bing UET supports advanced consent mode. Use defaultConsent to set the default state before the script loads. If consent is denied, UET only sends anonymous data.

<script setup lang="ts">
const { proxy } = useScriptBingUet({
  defaultConsent: { ad_storage: 'denied' },
})

function grantConsent() {
  proxy.uetq.push('consent', 'update', {
    ad_storage: 'granted',
  })
}
</script>

You can still use onBeforeUetStart for any other pre-load setup.