To set up a Facebook Pixel you create a dataset in Meta Events Manager, paste the base code into the <head> of every page on your site, configure the handful of events that matter for your business, then verify the whole thing with Meta Pixel Helper before you spend a dollar. Budget about ninety minutes if you’re doing it manually, twenty if your store platform has a partner integration.
Most guides stop at “paste the code.” That’s the part that works on the first try. The parts that go wrong are the events: wrong parameters, double-firing, a purchase event on a page that redirects before the pixel can send anything. This walkthrough covers the install and the failure modes, written for an owner who delivers their own orders rather than for an agency managing a national store.
For the background first, meaning what the pixel is, what it records, and how it handles delivery orders, start with what a Facebook Pixel is and what it tracks, then come back here to build it.
Save 80% of delivery management time
We handle everything:
- Dedicated operations manager
- Real-time tracking dashboard
- Automated customer notifications
- Urgent issue resolution
The Bottom Line
- Create the dataset in Events Manager, install the base code sitewide in the
<head>, then add events one at a time and test each one. - Five events cover most delivery businesses:
PageView,ViewContent,AddToCart,InitiateCheckoutandPurchase. Attachvalueandcurrencyto the purchase, always. - Verify your domain in Business Manager. Skipping this breaks attribution in ways that are hard to diagnose later.
- Pair the pixel with the Conversions API and send the same
event_idon both copies so nothing gets counted twice. - Test with Meta Pixel Helper and Events Manager’s Test Events tool before launching. A pixel that fires twice is worse than one that doesn’t fire at all, because it looks like it’s working.
What you need before you start
Four things, and gathering them first saves a lot of tab-switching:
- A Meta Business Manager account. This is where the pixel, your ad account and your domain verification all live. Personal ad accounts work but make life harder later.
- Access to your website’s code or CMS. Specifically, the ability to edit the
<head>section sitewide. On WordPress that’s a theme header file or a header-scripts plugin; on Shopify, Squarespace or Wix it’s usually a settings field. - Your order confirmation page URL. You need to know where customers land after paying, because that’s where the purchase event fires.
- Chrome with the Meta Pixel Helper extension. Free, and it’s the only sane way to confirm anything is working.
Step 1: Create your dataset in Meta Events Manager
Open Events Manager and click Connect data in the top left. Choose Web, then Next. Click Create new dataset, name it something you’ll recognise in six months (your business name plus “web” is fine), then click Create.
Meta will then offer you two paths: a partner integration or a manual code install. Meta’s own recommendation at this screen is “Conversions API and Meta Pixel,” which is the right choice, but you can add the server side afterwards rather than doing everything at once.
Note your pixel ID. It’s a 15- or 16-digit number and you’ll need it repeatedly.
Step 2: Install the base code sitewide
The base code goes between the opening and closing <head> tags, on every page. Not just the homepage, not just the checkout. Every page, or your audiences will have holes in them.
<script>
!function(f,b,e,v,n,t,s){/* Meta's standard snippet */}
(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>Copy the snippet from Events Manager rather than retyping it. The loader function is long, and a single character out of place breaks it silently.
If your platform has a partner integration, use it. Shopify, WooCommerce, Squarespace and most major builders offer one, and it handles both the base code and the common events automatically. The one rule: pick one method and stick to it. Installing through the native integration and pasting code into your theme is the single most common way people end up with duplicate events.
Step 3: Choose the events your business actually needs
Meta offers 17 standard events. Configuring all of them is a waste of an afternoon. For a business taking local orders, this set covers it:
- PageView — fires automatically from the base code. Nothing to do.
- ViewContent — on product, menu or item pages.
- AddToCart — when something goes into the basket.
- InitiateCheckout — when the order form opens. Keep this one for local delivery, because address entry usually happens here and it’s where out-of-zone customers abandon.
- Purchase — on the order confirmation page, with
valueandcurrencyattached. - Lead — only if you take quote requests or catering enquiries. Skip it if you don’t.
You can fire these from your code, or create them as custom conversions in Events Manager based on URL rules. Code-based standard events carry richer parameters, so prefer them for Purchase at minimum.
Step 4: Get the purchase event right
Everything else is optional; this one is not. A Purchase event without value and currency tells Meta’s bidding model that every order is worth the same, which is never true.
fbq('track', 'Purchase', {
value: 115.00,
currency: 'USD',
contents: [{ id: 'SKU-4410', quantity: 1 }],
content_type: 'product',
delivery_category: 'home_delivery'
});Add that last line if you deliver. delivery_category takes home_delivery, curbside or in_store, and it lets you split your reporting and your audiences by how the order was fulfilled. What to do with the split once you have it is covered in the guide to the pixel for local delivery. Here, just set the value from whatever the customer picked at checkout.
If you run Advantage+ catalogue ads, contents or content_ids becomes required rather than optional on your product events.
Step 5: Verify your domain
In Business Manager, go to Brand Safety and Suitability → Domains, add your domain, and verify it with one of the three methods offered: a DNS TXT record, an HTML file upload, or a meta tag.
This step gets skipped constantly and it shouldn’t be. Unverified domains produce data mismatches and limit which conversion events you can prioritise in Aggregated Event Measurement. The symptoms show up weeks later as attribution that doesn’t add up, and by then nobody remembers the install.
Step 6: Add the Conversions API and deduplicate
A browser-only pixel misses a lot in 2026: ad-blocked desktop sessions, iOS users who opted out of tracking, anyone who declined cookies. The Conversions API sends the same events from your server, where none of that applies.
Most platforms now offer this as a toggle or a partner app; a custom site needs a developer. Either way, the thing you must get right is deduplication. Send the same event name and the same event_id on both the browser copy and the server copy of a single action. Meta uses that ID to recognise the two as one event rather than two.
The event_id should represent the business action, and your order number works well for this. It must not change between the browser call and the server call.
Once data is flowing, check the Event Match Quality score in Events Manager. It’s a 0–10 rating of how well Meta can connect your events to real accounts, updated on a rolling 48-hour window. Aim for 6 or higher; 8 to 10 means you’re passing rich customer data. If it’s low, you’re usually not sending hashed email or phone with the server events.
Step 7: Test before you spend
Three checks, in this order.
Start with Meta Pixel Helper. Load your site with the Chrome extension active. A working pixel shows a green check, your pixel ID, and the events that fired. If you see the same event listed twice, you have a duplicate install, and that gets fixed before anything else.
Then open Test Events in Events Manager. It shows events arriving in real time. Walk through your own site as a customer would: view an item, add it, start checkout, complete a test order. Watch each event land.
Last, run the redirect check. Place a live order and confirm the Purchase event fires. A very common failure is a purchase event sitting on a checkout page that immediately redirects to a thank-you page, so the pixel never gets time to send. The fix is to move the event to the thank-you page, or add a short delay before the redirect.
Common Facebook Pixel setup mistakes
| Symptom | Usual cause | Fix |
|---|---|---|
| Purchase count roughly double real orders | Pixel installed twice, e.g. native integration plus theme code | Remove one install; confirm with Pixel Helper |
| No Purchase events at all | Event on a page that redirects before firing | Move the event to the confirmation page |
| Events fire, revenue shows as zero | value and currency missing | Add both parameters to the Purchase event |
| Events on some pages only | Base code not sitewide | Move it to the global header template |
| Attribution numbers don’t reconcile | Domain never verified | Verify in Business Manager |
| Low Event Match Quality | Server events sent without hashed customer data | Pass hashed email and phone through the Conversions API |
How long until the pixel is useful?
The base code starts collecting immediately, but the data isn’t useful on day one. Custom audiences need population before you can retarget against them, and Meta’s optimization needs roughly 50 conversion events per week per ad set before its bidding settles down.
For a small local operation that can take a few weeks. It’s the main argument for installing the pixel well before the season you actually want to advertise in, rather than the week of.
Frequently asked questions
Where exactly does the Facebook Pixel code go? Between the opening and closing <head> tags, on every page of the site. Putting it in the body works but fires later and misses some page views.
Can I set up a Facebook Pixel without a developer? On Shopify, Squarespace, Wix or WordPress with a header plugin, yes. The base code and basic events are a copy-paste job. The Conversions API usually needs either a platform integration or developer help.
How many pixels should I have? One per website. Multiple pixels on one site fragment your data and make audiences smaller than they should be.
Why is Meta Pixel Helper showing a warning but the pixel still works? Warnings are common and not all of them matter. The ones to act on are duplicate pixel IDs, missing required parameters on purchase events, and events firing on the wrong pages. A generic “no events found” on a page with no configured events is expected.
Do I still need the pixel if I’ve set up the Conversions API? Yes. Meta’s guidance is to run both. The browser pixel captures signals like _fbp and _fbc that improve matching, and the server side covers what the browser loses.
Sources: Meta for Developers: Get started with the Meta Pixel, Meta Business Help Centre: Set up and install the Meta Pixel, Meta Business Help Centre: Specifying Delivery Methods With Facebook Pixel Parameters, Meta Pixel Helper 2026 debugging guide, AdsUploader, Conversions API Event Match Quality in 2026, AdBeacon, Top Meta Pixel Mistakes, Conversios.