1.0.3 • Published 11 months ago

vue3-facebook-pixel v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Vue 3 Facebook Pixel

Tiny wrapper around Facebook Pixel API for Vue 3.

Prerequisites

To use this plugin you need an installed Facebook Pixel.

Install

With NPM:

$ npm i vue3-facebook-pixel --save

Usage

Vue 3 Composition API

main.js:

import { createApp } from 'vue'
import { VueFbq } from 'vue3-facebook-pixel'

import App from './App.vue'

const app = createApp(App)
  
app.use(VueFbq, { pixelId: 'your-pixel-id', debug: true })

MyComponent.vue:

<script setup>
import { useFbq } from 'vue3-facebook-pixel'

const fbq = useFbq()

const trackPurchase = () => {
  // events reference: https://developers.facebook.com/docs/meta-pixel/reference
  fbq.event('Purchase', {
    currency: 'USD',
    value: '7.99'
  })
}
</script>
1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago