How to Set Up Meta Pixel (Facebook Pixel) on Your Website
The Meta Pixel is a snippet of JavaScript code that goes on your website to track visitor actions and attribute them back to your Facebook and Instagram ads. Create the pixel in Events Manager, install the base code on every page (either manually, through GTM, or via your platform's native integrati
Quick Summary
The Meta Pixel is a snippet of JavaScript code that goes on your website to track visitor actions and attribute them back to your Facebook and Instagram ads. Create the pixel in Events Manager, install the base code on every page (either manually, through GTM, or via your platform's native integration), then set up events for the actions you want to track — PageView fires automatically, but you need to add events like Lead, Purchase, AddToCart, and ViewContent for meaningful tracking. Always verify with the Meta Pixel Helper Chrome extension and test events in Events Manager's Test Events tool.
What Is the Meta Pixel?
The Meta Pixel (formerly the Facebook Pixel) is JavaScript code installed on your website. When someone visits your site after interacting with your ads, the pixel fires and sends data back to Meta. It enables conversion tracking (measuring what happens after ad clicks), optimisation (Meta's algorithm learns which actions are valuable), and audience building (creating custom audiences for retargeting and lookalikes).
Common Issues
Pixel not firing: Check that the base code is in the <head> and no JavaScript errors are blocking it.
Events firing on wrong pages: Review your GTM triggers or event code placement.
Duplicate events: You likely have the pixel installed both directly and through a platform integration. Remove one.
iOS 14+ data gaps: Expected behaviour due to Apple's ATT framework. Set up Conversions API (CAPI) for server-side tracking to recover lost data.
Domain verification warning: Verify your domain in Business Suite > Settings > Brand Safety > Domains.
Event Parameters Cheat Sheet
For Purchase: always include value and currency. For Lead: value and currency recommended. For AddToCart: value, currency, content_ids recommended. For ViewContent: value, currency, content_ids, content_name recommended. The more parameters you pass, the better Meta can optimise.
What to Do Next
Set up the Conversions API (CAPI) for server-side tracking, verify your domain, create custom audiences based on pixel data, configure Aggregated Event Measurement for iOS tracking, and build your first conversion campaign.
Process Flow
Interactive diagram — drag to pan, scroll to zoom
Step-by-Step Guide
Follow these 5 steps to complete this guide
Create the Meta Pixel
Install the Pixel
Copy the base pixel code from Events Manager and paste it in the `
` section of every page. The base code automatically fires a PageView event on every page load.Option B: Google Tag Manager (Recommended)
In GTM, create a new Custom HTML tag, paste the Meta Pixel base code, set the trigger to All Pages, test in Preview Mode, and publish.
Option C: Platform-Specific Integration
Shopify: Online Store > Preferences > Facebook Pixel — enter your Pixel ID. Automatically tracks PageView, ViewContent, AddToCart, InitiateCheckout, and Purchase.
WordPress/WooCommerce: Use PixelYourSite or Facebook for WooCommerce plugin.
Wix: Marketing & SEO > Marketing Integrations > Facebook Pixel.
Webflow: Project Settings > Integrations > Head Code section.
Set Up Standard Events
Lead — form submissions: `fbq('track', 'Lead');`
Purchase — transactions: `fbq('track', 'Purchase', {value: 99.99, currency: 'AED'});`
AddToCart — cart additions: `fbq('track', 'AddToCart', {value: 49.99, currency: 'AED', content_ids: ['SKU123']});`
ViewContent — key page views: `fbq('track', 'ViewContent', {content_name: 'Running Shoes', value: 199.99, currency: 'AED'});`
Contact — business enquiries: `fbq('track', 'Contact');`
Place event code on thank-you pages, trigger inline on button clicks, or use GTM triggers for the cleanest implementation.
Configure Events in Events Manager
Verify Your Installation
Test Events Tool: In Events Manager > Test Events, enter your website URL, perform actions on your site, and see events appear in real-time.
Events Manager Overview: After a few hours, check the Overview tab to see event graphs.
Frequently Asked Questions
Common questions about this topic
Was this guide helpful?
Your feedback helps us improve our guides