Meta Pixel Setup: Datasets, Events, Testing and Common Errors
Rafael Moreira
خبير تسويق أداء أول
A working meta pixel setup has five parts: create the dataset in Events Manager, install the pixel one way only, send standard events with real value, currency and content_ids, test every event before spending, and pair the pixel with the Conversions API using a shared event ID. This guide covers each part from Meta's own developer documentation, including two names that changed recently: pixels now live in "datasets", and Pixel Helper is now Meta Ads Data Advisor.
Quick answer: In Events Manager, connect a new web data source and create a dataset; its ID is your pixel ID. Install it through a partner integration such as Shopify, by pasting the base code in the <head> of every page, or through Google Tag Manager, never two at once. Send ViewContent, AddToCart, InitiateCheckout and Purchase, with value and currency (required on Purchase) and content_ids. Check events with Meta Ads Data Advisor and the Test Events tab, then add the Conversions API with matching event IDs.
This is the Meta version of our TikTok Pixel setup guide. Server events get their own article, Meta Conversions API for ecommerce, so this one stays on the browser side.
What does the Meta Pixel do, and what is a dataset?
The Meta Pixel is a snippet of JavaScript that tells Meta what people do on your website after they see or click an ad. Meta's get started guide says it relies on Facebook cookies to match visitors to their accounts. The events you add feed conversion reporting, optimisation towards goals such as purchases, and audiences built from site visitors.
Dataset is the current word. In Events Manager, Meta groups browser and server events under datasets. Its Ads CLI documentation on datasets puts it plainly: "A dataset represents a Meta Pixel or Conversions API endpoint." Older guides, and many partner apps, still say "pixel" and "pixel ID". They mean the same thing: the dataset ID is the ID you paste into Shopify, Google Tag Manager or your server. One dataset per website is the normal setup, receiving browser and server events alike.
طبّق هذا الدليل عمليًا
أطلق حملاتك واختبرها ووسّعها على ست منصات إعلانية من مكان واحد، مع Wavo، فريقك من وكلاء الذكاء الاصطناعي، إلى جانبك. مجانًا لمدة 14 يومًا.
How do you create a Meta Pixel in Events Manager?
Creating the dataset takes a few minutes. Meta's datasets documentation notes that a business admin must accept the Meta Business Tools terms before a dataset can be created, and that datasets have to be connected to ad accounts and catalogues before you use them.
- Open Events Manager in the business portfolio that owns the website (Meta's current name for what used to be Business Manager).
- Choose the option to connect a new data source and select Web.
- Create a new dataset and give it a clear name, such as "Store name, main domain".
- Copy the dataset ID from the dataset's settings. This is your pixel ID.
- Connect the dataset to the ad account that will optimise for it, and to your catalogue if you run catalogue ads.
Meta has renamed the buttons in this flow more than once ("Connect data sources", "Connect data"), so follow the wording you see rather than an old screenshot.
Agencies: create the dataset in the client's business portfolio, not your own, and get access through a partner share.
How do you install the Meta Pixel on your website?
Pick one install route per website and remove every other. The single most common error in a Meta pixel setup is the same pixel loaded twice, for example by a Shopify app and by code left in the theme, which makes every event fire twice.
| Route | How it works | Best for | Watch out for |
|---|---|---|---|
| Partner integration | A platform app such as Shopify's Facebook & Instagram app connects the dataset | Stores on a supported platform | Old manual code still in the theme |
| Manual base code | Paste the base code in the <head> of every page, then add event calls | Custom sites with a developer | Event code on every template |
| Google Tag Manager | Base code in a tag on all pages, one tag per event | Sites already run through GTM | A second copy hardcoded in the site |
Partner integration (Shopify). On Shopify, the Facebook & Instagram app connects the dataset for you. Shopify's data sharing settings offer three levels: Standard uses the Meta Pixel only, while Enhanced and Maximum add the Conversions API. Our Shopify Facebook and Instagram app setup checklist covers the choices during setup, and Shopify server-side tracking compares what each level sends.
Manual base code. Meta "highly recommend[s]" adding the base code between the opening and closing <head> tags on every page you track, usually in the site's persistent header. There it is less likely to be blocked and runs sooner, so visitors who leave quickly are still tracked. The base code fires a PageView on every load; leave that call in place.
Google Tag Manager. Meta says the pixel works in most tag managers. The usual pattern is the base code in a Custom HTML tag that fires on all pages, then one tag per event on the right trigger, reading value, currency and product IDs from your data layer. Fire event tags only after the base code tag has loaded, and use preview mode while you build.
Which standard events and parameters should you send?
Meta defines 17 standard events in its standard events reference, from AddPaymentInfo to ViewContent, and the PageView in the base code comes on top. For an online store, four cover the funnel:
| Event | When it fires | Parameters worth sending |
|---|---|---|
| ViewContent | Product page view | content_ids, content_type, value, currency |
| AddToCart | Add to basket | content_ids or contents, content_type, value, currency |
| InitiateCheckout | Checkout begins | content_ids, num_items, value, currency |
| Purchase | Order confirmation | value and currency (required), content_ids, content_type, plus an eventID |
The reference marks currency and value as required on Purchase. For Advantage+ catalog ads, Purchase, ViewContent and Search also need contents or content_ids, and AddToCart needs contents. The content_type value must be product or product_group, matching the kind of ID you pass. If you leave it out, Meta matches the event to any item with the same ID, whatever its type. Our guide to Meta catalog ads explains why those IDs must match your feed exactly.
A Purchase call on the confirmation page looks like this:
fbq('track', 'Purchase', {
value: 64.00,
currency: 'USD',
content_ids: ['SKU-1042', 'SKU-2210'],
content_type: 'product'
}, { eventID: '4812' });
When should you use custom events or custom conversions?
Meta's conversion tracking guide gives three ways to track an action. Standard events are actions Meta has defined, sent with fbq('track'). Custom events are actions you define, sent with fbq('trackCustom'); their names must be strings of no more than 50 characters. Custom conversions are rules built in Events Manager on top of events or URLs, such as "any page whose URL contains /thank-you", with no extra code.
Use a standard event whenever one describes the action. Reach for a custom event only for actions no standard event covers, such as sharing a discount code, and for a custom conversion when you need a narrower version of an existing event. Our article on Meta custom conversions vs standard events covers the rules and limits.
Should you leave automatic events on?
In Events Manager, the Track events automatically without code setting lets Meta detect standard events from site activity. Meta's Data Advisor page says that from 3 August 2026 this option is pre-selected when you set up a new pixel through the extension. It helps a small site with no developer. On a store where Purchase is already coded or sent by a partner app, review what Meta detects so the same action does not have two sources.
How do you test the Meta Pixel before spending?
Test before any budget goes live, and again after every theme, checkout or app change.
- Meta Ads Data Advisor. The browser extension once called Meta Pixel Helper has a new name. Meta's Data Advisor documentation says existing Pixel Helper installs update automatically and keep their diagnostic features. It runs in Chrome and Edge, lists each pixel and event on the page with a status (Active, Warning, Inactive, Error or Auto-detected) and flags missing parameters such as
content_ids,valueandcurrency. Disable your ad blocker on the site under test, or it cannot see the pixel. - Test Events in Events Manager. Open your dataset and the Test Events tab to watch events arrive while you browse your own site. Meta's Conversions API documentation describes the server side of the same tool: it generates a
test_event_codethat you add to server events while testing and remove before going live. Meta notes that test events are not dropped; they flow into Events Manager and are used for targeting and measurement. - A real order. Place one, then compare the Purchase value, currency and event ID with the order in your store admin.
On a fresh install, Meta's get started guide says a PageView should appear in Events Manager after you load a page with the pixel; if it does not, wait a few minutes, refresh and check with Data Advisor.

Is domain verification still part of Meta Pixel setup?
Domain verification is still worth doing, but it is about ownership of your links more than about events. Meta's developer documentation describes it as the way to claim ownership of your domain in your business portfolio, which lets you control who can edit your link metadata and the link descriptions on ads pointing to your site. You verify by uploading an HTML file to the site's root directory or by adding a DNS TXT record.
Guides written around 2021 also tie domain verification to Aggregated Event Measurement, where advertisers had to rank up to eight events per domain in Events Manager. Meta has changed how Aggregated Event Measurement works since then, and we could not confirm the current screens from an official Meta page. Treat any old instruction to rank eight events per domain as something to check against your Events Manager today, not as a required step.
What are the most common Meta Pixel errors?
Most broken pixels fail in one of a handful of ways, and Data Advisor catches several of them.
- Two installs of the same pixel. A partner app plus code in the theme, or a GTM tag plus hardcoded base code. Data Advisor's checklist says to make sure there is no duplicate pixel code on any page.
- Two different pixels on one page, often an old one from a previous agency. Meta warns that the
trackcall on a page with several pixels initialised can over-fire; usetrackSingleto send an event to one pixel, or remove the pixel you no longer use. - Purchase firing twice, for example on every refresh of the confirmation page, or once in the browser and once from a "thank you" redirect.
- Missing
valueorcurrencyon Purchase, both required by Meta's reference. content_idsthat do not match the catalogue, such as variant IDs on the site and product IDs in the feed, so catalogue ads cannot match products.- Event code that runs before the base code, so the event call has no pixel to send to. Meta's checklist says standard events should load after the base pixel code.
- An ad blocker on during testing, which makes a healthy pixel look broken.
Even a clean pixel will not match your store's order count, because Meta attributes by click and view windows while your store counts orders. Our article on why Meta and Shopify numbers don't match covers how to reconcile the two.
How does the pixel work with the Conversions API?
The pixel runs in the browser, so ad blockers, browser privacy settings and closed tabs stop some events. Meta recommends what it calls a "redundant setup": sending events through both the pixel and the Conversions API, so the server catches what the browser misses. Meta may then receive each order twice.
Meta's deduplication guide sets the rule. The pixel's eventID, the fourth argument in the fbq call, must match the Conversions API's event_id, and the pixel's event name must match the server's event_name. If Meta finds both keys sent to the same pixel ID within 48 hours, it discards the later copy.
A worked example. A shopper places order 4812 for $64. The browser fires Purchase with eventID 4812, value 64 and currency USD. Seconds later your server sends Purchase with event_id 4812 to the same dataset. Meta keeps one purchase of $64, and if an ad blocker had stopped the browser event, the server copy would still record it. If the server sent "order-4812" instead, the IDs would not match and Meta could count two purchases, reporting $128.
Setting up the server side, choosing a route and reading match quality are covered in our Meta Conversions API guide and our article on Event Match Quality.
Where Wevion fits
Wevion does not install the Meta Pixel, send Conversions API events or deduplicate them. That stays with the pixel, your server or your store's Meta app.
Wevion connects Meta, Google, TikTok, Snapchat, Taboola and Outbrain ad accounts through each platform's official API, syncs data about every 15 minutes and shows the spend and conversions each platform reports side by side for every account you manage.
That makes a broken pixel easier to spot: if Meta purchases fall while the other platforms hold steady, the gap shows up next to them. Automated rules can just notify you, or pause ads and change budgets when a metric crosses your threshold, with a cooldown and a daily cap on runs, so an alert on a sharp drop in reported purchases becomes a prompt to open Events Manager.
The Wevion app for Shopify syncs orders, products, refunds and product costs; it does not send events to Meta. With those costs in place, Profitability Analytics, in beta, shows profit next to ad spend, a store-side check on what the pixel reports.
You can try it on your own ad accounts with 14 days free on any plan, no card.
Key takeaways
- A dataset in Events Manager represents your Meta Pixel and Conversions API endpoint; its ID is the pixel ID.
- Create it in the business portfolio that owns the site and install it one way only: partner integration, base code in the
<head>, or Google Tag Manager. - Send standard events; Purchase requires
valueandcurrency, and catalogue ads needcontent_idsthat match the feed. - Test with Meta Ads Data Advisor (formerly Pixel Helper), the Test Events tab and one real order.
- Verify your domain for link control, and check any old eight-event Aggregated Event Measurement instruction against your current Events Manager.
- Add the Conversions API with the same event name and event ID on both sides so each order counts once.
استكشف المزيد في
النظام البيئي والتعليم
اقرأ صفحة pillar مع جميع الأدلة حول هذا الموضوع، من الأساسيات إلى المستوى المتقدم.