Lucid Brands Home
©Lucid Brands 2026
Paid Media Marketing resource article: Meta Pixel: Setup and Troubleshooting

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:

  1. Go to Meta Events Manager from your Business Portfolio.
  2. Choose Connect data sources and select Web.
  3. Name your dataset (Meta now calls the pixel and its data a "dataset") and enter your website address.
  4. Choose how to install it: by partner integration (Shopify, WordPress, Wix, Squarespace and others), manually with code, or through Google Tag Manager.
  5. Turn on automatic advanced matching if it suits your privacy policy. It sends hashed customer details (like email) from forms to improve matching.
  6. Add the events you want to track.
  7. Test with the Test events tool and the Meta Pixel Helper browser extension.
  8. 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.

  1. 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.
  2. Fire the base tag on all pages.
  3. Create event tags (such as Lead or Purchase) triggered by thank you page views, form submissions or button clicks.
  4. 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.

EventWhen to fire itUseful for
PageViewEvery page load (in the base code)All sites
ViewContentA key page, like a product or service pageEcommerce, services
SearchA site searchLarger sites and stores
AddToCartAdding an item to the cartEcommerce
AddToWishlistSaving an itemEcommerce
InitiateCheckoutStarting checkoutEcommerce
AddPaymentInfoEntering payment detailsEcommerce
PurchaseCompleted order (send value and currency)Ecommerce
LeadForm submission or quote requestService businesses
CompleteRegistrationAccount or event sign upEvents, software, memberships
ContactCall, text, email or chat clickLocal businesses
ScheduleBooked appointmentClinics, salons, home services
SubmitApplicationSubmitted an applicationFinance, hiring, education
StartTrialStarted a free trialSubscriptions
SubscribePaid subscriptionSubscriptions
FindLocationUsed a store locatorMulti location businesses
CustomizeProductConfigured a productCustom products
DonateDonationNonprofits

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

  1. Install the Meta Pixel Helper extension in Chrome.
  2. Visit your site and check that the pixel loads with a PageView.
  3. Complete each conversion yourself (submit a test form, make a test purchase if possible).
  4. In Events Manager, open Test events, enter your site address and watch events arrive in real time.
  5. Check the Overview and Diagnostics tabs after a day for warnings.
  6. 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

SymptomLikely causeFix
Pixel Helper shows no pixelCode not installed or a caching plugin is serving old pagesReinstall, clear caches, check the code is in the head on every page
Duplicate eventsPixel installed twice (plugin plus manual code, or two plugins)Remove one installation
Lead event fires on every pageEvent code in the site wide header instead of only on the thank you pageMove it or fix the GTM trigger
Conversions missing for form submissionsForm shows a message instead of loading a thank you pageFire the event on the form's success callback or redirect to a thank you page
Purchases show without valueValue and currency parameters not sentAdd them in the event code or platform settings
Events in Events Manager but not in Ads ManagerDataset not connected to the ad account, or the campaign is not set to that eventConnect the dataset; select the event in the ad set
Numbers lower than your CRM or storeAd blockers, browser privacy limits, consent choices, iOS tracking limitsAdd the Conversions API; compare trends rather than exact counts
Domain warningsDomain not verified in Business SettingsVerify your domain

Meta Pixel vs Conversions API

Meta PixelConversions API
Where it runsIn the visitor's browserOn your server or platform
Affected by ad blockers and browser limitsYesMuch less
SetupEasierNeeds a platform integration, a gateway or developer help
Best useBrowser activity, audiences, quick setupMore 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.

  • 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.