Meta Pixel: Setup and Troubleshooting
The Meta Pixel (formerly the Facebook Pixel) is a small piece of code you add to your website that tells Meta when people who saw or clicked your Facebook and Instagram ads take actions on your site, such as viewing a page, filling in a form or buying. That data lets you measure results, build retargeting audiences and help Meta show your ads to people most likely to act. You set it up in Meta Events Manager, install it on your site, add events for the actions you care about and test it with the Pixel Helper.
What is the Meta Pixel?
The pixel is a short JavaScript snippet that loads on every page of your website. When someone visits, it sends information about that visit back to Meta, such as which page they viewed and whether they completed an action you are tracking. Meta matches that activity to people on Facebook and Instagram where it can.
It used to be called the Facebook Pixel. The name changed when Facebook's parent company became Meta. It works for ads on Facebook, Instagram, Messenger and Meta's Audience Network.
What the pixel does for your ads
- Measures results. See how many leads, purchases or bookings came from your ads, and what each one cost.
- Improves delivery. When you run a campaign optimized for leads or purchases, Meta uses pixel data to find people likely to take that action.
- Builds retargeting audiences. Show ads to people who visited your site, viewed a service page or started checkout. See retargeting ads.
- Builds lookalike audiences. Find new people similar to your website visitors or customers.
- Calculates return on ad spend. With purchase values, you can see revenue per dollar spent.
Without the pixel (or the Conversions API), Meta has to optimize for clicks, which often brings cheaper but lower quality traffic.
Before you start
- A Meta Business Portfolio (Business Manager) with admin access.
- Admin access to your website, tag manager or ecommerce platform.
- A list of the actions you want to track, such as form submissions, calls, bookings and purchases.
- A thank you page or confirmation step for each conversion, if possible. It makes tracking much easier.
- Your privacy policy updated to mention advertising cookies and tracking.
How to set up the Meta Pixel
Menu names change from time to time, but the steps are broadly:
- Go to Meta Events Manager from your Business Portfolio.
- Choose Connect data sources and select Web.
- Name your dataset (Meta now calls the pixel and its data a "dataset") and enter your website address.
- Choose how to install it: by partner integration (Shopify, WordPress, Wix, Squarespace and others), manually with code, or through Google Tag Manager.
- Turn on automatic advanced matching if it suits your privacy policy. It sends hashed customer details (like email) from forms to improve matching.
- Add the events you want to track.
- Test with the Test events tool and the Meta Pixel Helper browser extension.
- Connect the dataset to your ad account in Business Settings.
Install options: code, Google Tag Manager, Shopify, WordPress
Option 1: Add the code manually
Copy the base code from Events Manager and paste it just before the closing head tag on every page (most site builders have a "header code" box for this). It looks similar to this, with your own ID:
<script>
!function(f,b,e,v,n,t,s){...}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>
Then add event code on the right pages, for example on a form thank you page:
<script>fbq('track', 'Lead');</script>
Option 2: Google Tag Manager
If your site already uses Google Tag Manager, this is usually the cleanest method.
- In GTM, add a new tag using the Meta Pixel template from the community template gallery, or a custom HTML tag with the base code.
- Fire the base tag on all pages.
- Create event tags (such as Lead or Purchase) triggered by thank you page views, form submissions or button clicks.
- Preview, test and publish.
Option 3: Shopify
Install Meta's Facebook and Instagram sales channel app, connect your Business Portfolio and choose your data sharing level. Shopify's integration sends standard ecommerce events, including purchases, and supports the Conversions API.
Option 4: WordPress
Use Meta's official plugin or your form and ecommerce plugins' built in Meta integration. For WooCommerce, the official integration tracks ecommerce events automatically. Avoid installing the pixel twice through two plugins.
Standard events reference
Meta offers 17 standard events. You will usually need only a few.
| Event | When to fire it | Useful for |
|---|---|---|
| PageView | Every page load (in the base code) | All sites |
| ViewContent | A key page, like a product or service page | Ecommerce, services |
| Search | A site search | Larger sites and stores |
| AddToCart | Adding an item to the cart | Ecommerce |
| AddToWishlist | Saving an item | Ecommerce |
| InitiateCheckout | Starting checkout | Ecommerce |
| AddPaymentInfo | Entering payment details | Ecommerce |
| Purchase | Completed order (send value and currency) | Ecommerce |
| Lead | Form submission or quote request | Service businesses |
| CompleteRegistration | Account or event sign up | Events, software, memberships |
| Contact | Call, text, email or chat click | Local businesses |
| Schedule | Booked appointment | Clinics, salons, home services |
| SubmitApplication | Submitted an application | Finance, hiring, education |
| StartTrial | Started a free trial | Subscriptions |
| Subscribe | Paid subscription | Subscriptions |
| FindLocation | Used a store locator | Multi location businesses |
| CustomizeProduct | Configured a product | Custom products |
| Donate | Donation | Nonprofits |
For a typical service business, PageView, ViewContent, Contact, Lead and Schedule cover most needs. Pick one main event to optimize campaigns for.
Custom events and custom conversions
- Custom conversions let you define a conversion by URL (for example, any visit to /thank-you-quote) without new code. Good for simple sites.
- Custom events are your own event names for actions not covered by standard events. Use standard events first, because Meta's optimization understands them best.
- Parameters add detail such as value, currency and content name. Always send value and currency with purchases.
Test your pixel
- Install the Meta Pixel Helper extension in Chrome.
- Visit your site and check that the pixel loads with a PageView.
- Complete each conversion yourself (submit a test form, make a test purchase if possible).
- In Events Manager, open Test events, enter your site address and watch events arrive in real time.
- Check the Overview and Diagnostics tabs after a day for warnings.
- Review Event Match Quality for your key events. Higher scores mean Meta can match more events to people.
Troubleshooting a Meta Pixel that is not working
| Symptom | Likely cause | Fix |
|---|---|---|
| Pixel Helper shows no pixel | Code not installed or a caching plugin is serving old pages | Reinstall, clear caches, check the code is in the head on every page |
| Duplicate events | Pixel installed twice (plugin plus manual code, or two plugins) | Remove one installation |
| Lead event fires on every page | Event code in the site wide header instead of only on the thank you page | Move it or fix the GTM trigger |
| Conversions missing for form submissions | Form shows a message instead of loading a thank you page | Fire the event on the form's success callback or redirect to a thank you page |
| Purchases show without value | Value and currency parameters not sent | Add them in the event code or platform settings |
| Events in Events Manager but not in Ads Manager | Dataset not connected to the ad account, or the campaign is not set to that event | Connect the dataset; select the event in the ad set |
| Numbers lower than your CRM or store | Ad blockers, browser privacy limits, consent choices, iOS tracking limits | Add the Conversions API; compare trends rather than exact counts |
| Domain warnings | Domain not verified in Business Settings | Verify your domain |
Meta Pixel vs Conversions API
| Meta Pixel | Conversions API | |
|---|---|---|
| Where it runs | In the visitor's browser | On your server or platform |
| Affected by ad blockers and browser limits | Yes | Much less |
| Setup | Easier | Needs a platform integration, a gateway or developer help |
| Best use | Browser activity, audiences, quick setup | More reliable conversion data, offline and CRM events |
Most advertisers should run both, with the same event names and an event ID so Meta can remove duplicates. Shopify, WordPress plugins and many CRMs now include Conversions API options. See our guide to the Conversions API and broader conversion tracking.
Privacy, consent and data rules
- Mention advertising cookies and the Meta Pixel in your privacy policy.
- If you serve visitors in places that require consent before tracking, use a consent banner that holds the pixel until visitors agree.
- Do not send sensitive information (health conditions, financial details, full names in URLs) to Meta. Meta restricts certain data, especially for health and finance advertisers.
- Review what your automatic advanced matching and form integrations send.
FAQ
What is the point of a Meta pixel?
It connects what people do on your website to your Facebook and Instagram ads, so you can measure leads and sales, retarget visitors and let Meta optimize toward real results instead of clicks.
How much do 1000 clicks cost on Facebook?
It varies widely by industry, audience, location and season, so there is no single price. The pixel helps you see cost per lead or sale, which matters more than cost per click. See how much Facebook ads cost.
What's the difference between Facebook and Meta?
Meta is the parent company. Facebook is one of its apps, alongside Instagram, WhatsApp and Messenger. The Facebook Pixel was renamed the Meta Pixel because it works across Meta's apps.
Do I still need the Meta Pixel if I use the Conversions API?
Yes, in most cases. The pixel captures browser activity and builds audiences quickly, while the Conversions API fills gaps the browser misses. Running both, with deduplication, gives the most complete data.
Make sure your ads are tracking real results
Lucid Brands' free media audit checks your Meta Pixel, Conversions API and conversion setup and shows where data is missing. Our Media Management service, from $500 a month, runs Facebook advertising and Instagram campaigns with tracking built in from day one.
Your path to lucidity
Get Started With a Free Paid Media Audit
Not sure where to begin? Start with a free paid media audit. We'll show you where your current spend is working, where it's leaking, and what we'd do first.
Explore More
Related Resources
Google Ads Conversion Tracking Setup
How to set up Google Ads conversion tracking: choose between the Google tag, Google Tag Manager and GA4 import, add enhanced conversions, track calls and offline sales, set primary and secondary actions, test and fix common problems.
Read More
Google Ads Setup Guide
A step by step Google Ads setup guide: account and billing, Expert Mode, conversion tracking with GA4, a first Search campaign, settings to change, keywords, ads, budget, a prelaunch checklist and a 30 day plan.
Read More
Google Local Services Ads in 2026: Cost, Setup and What Changed
How Google Local Services Ads work in 2026: the move into Google Ads, pay per lead costs, missed call billing, Google Verified, setup steps and how to rank.
Read More