Gatsby plugin to add a Facebook Pixel to your site.
npm install --save @hutsoninc/gatsby-plugin-facebook-pixel
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: '@hutsoninc/gatsby-plugin-facebook-pixel',
options: {
pixelId: 'YOUR_PIXEL_ID',
},
},
]
}
This plugin provides a fbq
function to prevent SSR issues.
To use it, simply import it and use it like the normal fbq
function.
import { fbq } from '@hutsoninc/gatsby-plugin-facebook-pixel'
fbq('track', 'Contact')
MIT © Hutson Inc