---
title: "Meta Pixel"
description: "Load Meta Pixel, send events through fbq, and manage its binary consent state."
canonical_url: "https://scripts.nuxt.com/scripts/meta-pixel"
last_updated: "2026-08-10T04:32:13.745Z"
---

[Meta Pixel](https://www.facebook.com/business/tools/meta-pixel) sends conversion and audience events to Meta Ads.

[`useScriptMetaPixel()`](/scripts/meta-pixel) loads the pixel and exposes the `fbq` queue.

<script-stats>



</script-stats>

<script-docs>



</script-docs>

<script-types>



</script-types>

## Consent Mode

Meta Pixel exposes a binary consent toggle. Set the initial state with `defaultConsent` (fires `fbq('consent', 'grant'|'revoke')` before `fbq('init', id)`) and call `consent.grant()` / `consent.revoke()` at runtime:

```vue
<script setup lang="ts">
const { consent } = useScriptMetaPixel({
  id: 'YOUR_PIXEL_ID',
  defaultConsent: 'denied',
})

function acceptAds() {
  consent.grant()
}
function rejectAds() {
  consent.revoke()
}
</script>
```

`defaultConsent: 'denied'` queues a revoke command before pixel initialization, but it does not delay the SDK request. If your consent policy requires no request to Meta before opt-in, use a [binary load gate](/docs/guides/consent#binary-load-gate) for the script itself.
