To set up the Meta Pixel and Conversions API, create a dataset (pixel) in Meta Events Manager, install the pixel on every page of your site, send the same key events from your server through the Conversions API, and give each browser and server copy of an event the same event_name and event_id so Meta counts it once. Then check the setup in the Test Events tab and raise your Event Match Quality by sending hashed email and phone plus the _fbp and _fbc cookies.
This guide covers the full setup, the four ways to connect the Conversions API, and a launch checklist you can copy.
Contents
- What the Meta Pixel and Conversions API do
- Why you need both (and not just the pixel)
- Before you start: what you need
- Step 1: Create your dataset and install the pixel
- Step 2: Choose your standard events
- Step 3: Choose how to connect the Conversions API
- Step 4: Send server events with the right parameters
- Step 5: Deduplicate browser and server events
- Step 6: Test, then improve Event Match Quality
- The launch checklist
- Common mistakes
- FAQ
1. What do the Meta Pixel and Conversions API do?
The Meta Pixel is a piece of JavaScript that runs in the visitor's browser. When someone views a page, adds to cart or submits a form, the pixel sends that event to Meta. In Events Manager, Meta now groups pixel and server data under a dataset; your dataset ID and your pixel ID are the same number.
The Conversions API (CAPI) sends the same kind of events from your server (or a server you control) straight to Meta. Because the event does not depend on the visitor's browser, it still arrives when a script is blocked, a page closes before the pixel fires, or the conversion happens later in your CRM.
Meta uses these events for three jobs:
- Measurement – counting leads, purchases and cost per result.
- Optimisation – telling the delivery system which people turned into customers, so it finds more like them.
- Audiences – building retargeting audiences (site visitors, add-to-carts) and lookalikes.
2. Why do you need both the pixel and the Conversions API?
Browser tracking has become less reliable over the years: ad blockers, browser privacy features, cookie consent banners and slow pages all stop some pixel events from firing. Server events fill those gaps. The pixel, in turn, still captures browsing behaviour (page views, scroll-driven events, content views) cheaply and gives Meta browser signals such as the _fbp cookie.
Meta's own recommendation is a redundant setup: send key events from both the browser and the server, and let deduplication remove the double counts. You get the coverage of the server and the context of the browser.
| Meta Pixel (browser) | Conversions API (server) | |
|---|---|---|
| Where it runs | Visitor's browser | Your server, a cloud gateway or a partner platform |
| Blocked by ad blockers? | Often | No |
| Can send offline/CRM events? | No | Yes (for example a lead marked "qualified" days later) |
| Best for | Page views, content views, add to cart | Leads, purchases, qualified leads, subscriptions |
3. What do you need before you start?
- A Meta Business portfolio (Business Manager) with admin access, and your ad account inside it.
- Access to your website (CMS admin, theme files or Google Tag Manager).
- A clear list of the 2–4 conversions that matter to your business. For a lead-gen site that is usually Lead and a "qualified lead" step; for a shop, AddToCart, InitiateCheckout and Purchase.
- Your cookie consent setup, if you serve visitors in regions with consent rules such as the EU or UK. Tracking should respect the visitor's choice.
- Optional: a verified domain in Business Settings. Meta no longer requires it for event configuration, but it still proves ownership and controls link editing.
4. Step 1: How do you create a dataset and install the Meta Pixel?
- Open Events Manager and choose Connect data (sometimes shown as "Connect data sources"), then Web.
- Name the dataset after the website (for example "Acme Plumbing – website") and add your site's URL.
- Pick how to install it:
- Partner integration – Shopify, WooCommerce, WordPress, Wix, Squarespace and many others have official Meta connections. This is the easiest route and often switches on the Conversions API at the same time.
- Manual install – copy the base code into the <head> of every page, or add it once through Google Tag Manager with an "All Pages" trigger.
- Install the Meta Pixel Helper Chrome extension, load your site and confirm you see a PageView event with your pixel ID.
- Connect the dataset to your ad account in Business Settings → Data sources, so ads can optimise for its events.
5. Step 2: Which standard events should you track?
Meta has a list of standard events that its systems understand without extra setup. Use them wherever they fit, rather than inventing custom names. Here is a practical map:
| Business type | Event | When it fires | Send from |
|---|---|---|---|
| All | PageView | Every page load | Pixel |
| All | ViewContent | Key service or product page | Pixel |
| Lead generation | Lead | Form submitted successfully (thank-you page or success callback) | Pixel + CAPI |
| Lead generation | Schedule / custom "QualifiedLead" | Booking made, or lead marked qualified in CRM | CAPI |
| E-commerce | AddToCart | Item added to cart | Pixel + CAPI |
| E-commerce | InitiateCheckout | Checkout started | Pixel + CAPI |
| E-commerce | Purchase (with value and currency) | Order confirmed | Pixel + CAPI |
| SaaS / subscriptions | CompleteRegistration, StartTrial, Subscribe | Account created, trial started, first payment | Pixel + CAPI |
Fire the Lead event on confirmed submissions only. A Lead event on a button click counts people who clicked but failed validation, which teaches Meta to find clickers, not leads. Always send value and currency with Purchase (for example value 89.00, currency USD); without them, value-based bidding and ROAS reporting cannot work. If you are new to ROAS, our guide What Is ROAS? explains how to work out your break-even number.
A note on the old "8 events" rule: Meta used to make advertisers rank up to eight web events under Aggregated Event Measurement. That prioritisation step has been removed, so you no longer need to configure event priority before optimising for an event.
6. Step 3: Which Conversions API setup method should you choose?
There are four common ways to connect the Conversions API. Pick the simplest one that sends the events you need with good customer information.
| Method | Skill needed | Running cost | Good fit | Watch out for |
|---|---|---|---|---|
| Partner integration (Shopify, WooCommerce, WordPress plugin, CRM connector) | Low | Usually none beyond your platform | Standard shops and sites on a supported platform | Check it sends event_id for deduplication and includes email/phone |
| Conversions API Gateway (Meta's, hosted in your own cloud or via a managed provider) | Low to medium | Cloud or provider fee | Sites that cannot add server code but want server events for pixel events | Mirrors pixel events, so it cannot add offline CRM events on its own |
| Server-side Google Tag Manager with a Meta CAPI tag | Medium | Server hosting fee | Teams already using GTM and GA4 who want one pipeline for many platforms | Needs careful mapping of event_id, user data and cookies |
| Direct API from your backend or CRM | High (developer) | Developer time | Lead-gen businesses that want to send "qualified" or "closed" events from the CRM | You own maintenance, token security and error handling |
Whatever you choose, you will get a dataset ID and generate an access token in Events Manager (Settings → Conversions API). Treat the token like a password: store it on the server, never in front-end code.
7. Step 4: What parameters does a server event need?
A server event that Meta can use well contains these fields:
- event_name – the same standard event name you use in the pixel (for example Lead).
- event_time – a Unix timestamp in seconds of when the action happened. Events can be sent up to seven days after they occurred; older events are rejected, so send CRM events promptly.
- event_id – a unique ID for this action, shared with the pixel (see Step 5).
- action_source – where it happened: website, phone_call, chat, physical_store, system_generated and so on.
- event_source_url – the page URL, required for website events.
- user_data – customer information: hashed email (em), hashed phone (ph), hashed first and last name, city, postcode and country where you have them, plus client_ip_address, client_user_agent, fbp, fbc and external_id.
- custom_data – value, currency, content IDs and other details.
Hashing rules
Meta requires personal fields to be normalised and then hashed with SHA-256 before sending. Partner integrations do this for you; if you build it yourself:
- Email: trim spaces and lowercase, then hash. " Jane.Doe@Example.com " becomes "jane.doe@example.com" before hashing.
- Phone: digits only, include the country code, no leading zeros or symbols. A US number (415) 555-0123 becomes 14155550123.
- Do not hash client_ip_address, client_user_agent, fbp or fbc. Hashing external_id is recommended.
Worked example: one lead, two copies
A visitor fills in a quote form on a plumbing site. The browser shows the thank-you page and the server saves the lead to the CRM. Both send a Lead event:
| Field | Pixel (browser) | Conversions API (server) |
|---|---|---|
| Event name | Lead | Lead |
| Event ID | eventID: "lead-7f3a91" | event_id: "lead-7f3a91" |
| Customer info | _fbp cookie (automatic) | Hashed email + phone, fbp, fbc, IP, user agent |
| Result in Events Manager | One Lead counted, with the richer server data used for matching | |
8. Step 5: How do you deduplicate pixel and server events?
When you send the same event from both places, Meta needs to know they are one action. It deduplicates when the browser event's eventID and the server event's event_id match and the event names match. Meta's documentation states the match applies to events received within 48 hours of the first one with that ID.
How to do it in practice:
- Generate one ID when the action happens – for example when the form is submitted – and store it (a hidden form field, the order number or the lead ID all work).
- Pass it to the pixel:
fbq('track', 'Lead', {}, {eventID: 'lead-7f3a91'}); - Send the same value as event_id in the server event.
The most common mistake is generating a random ID separately in the browser and on the server. They never match, so every conversion is counted twice, your cost per lead looks half of what it really is, and Meta optimises on inflated data.
9. Step 6: How do you test the setup and improve Event Match Quality?
Testing
- In Events Manager, open your dataset and go to Test events. Copy the test code and add it to your server events temporarily (or use the browser test option for the pixel).
- Submit a real test lead or order on your site.
- Confirm you see the event twice – once marked Browser, once Server – and that it shows as deduplicated.
- After a day or two, check the Overview tab: server and browser volumes should be broadly similar for deduplicated events, and the Diagnostics tab should show no warnings.
Event Match Quality
Event Match Quality (EMQ) is a score out of 10 that Meta gives each web event, estimating how well its customer information can be matched to Meta accounts. Better matching usually means more conversions attributed and better optimisation. To raise it:
- Send hashed email and phone with every Lead and Purchase server event – these usually move the score the most.
- Pass the _fbc cookie (or build it from the fbclid in the landing URL) and the _fbp cookie.
- Include IP address and user agent from the original browser request, not from your server.
- Add external_id (your own customer or lead ID, hashed) so returning customers match consistently.
- Turn on automatic advanced matching in the pixel settings, so the pixel can pass hashed form fields too.
Treat a low score as a to-do list: Events Manager shows which parameters are missing for each event.
10. The Meta tracking launch checklist
Copy this into your project notes and tick each item before you spend on conversion campaigns.
| # | Check | Done? |
|---|---|---|
| 1 | Dataset created and connected to the right ad account | ☐ |
| 2 | Pixel base code fires PageView on every page (Pixel Helper confirms) | ☐ |
| 3 | Lead / Purchase fire only on confirmed success, not on button clicks | ☐ |
| 4 | Purchase sends value and currency | ☐ |
| 5 | Conversions API connected (partner, Gateway, sGTM or direct) | ☐ |
| 6 | Same event_id sent by pixel and server for each key event | ☐ |
| 7 | Test Events shows Browser + Server, deduplicated | ☐ |
| 8 | Hashed email and phone included in server events | ☐ |
| 9 | fbp and fbc passed; IP and user agent from the visitor | ☐ |
| 10 | Access token stored server-side only | ☐ |
| 11 | Consent choices respected for regions that need them | ☐ |
| 12 | Diagnostics tab clear; EMQ reviewed and improved | ☐ |
| 13 | Ads Manager lead count compared against your CRM for one week | ☐ |
Item 13 matters more than any score. If Ads Manager shows 40 leads in a week and your CRM shows 25, find the gap before scaling. Our Max CPL lab helps you set the highest cost per lead you can afford once your numbers are trustworthy.
11. What are the most common Meta Pixel and CAPI mistakes?
- Double-counting because event IDs do not match, or because a plugin and a hand-coded pixel both fire.
- Thin server events with no email or phone, which keeps match quality low.
- Using the server's IP address instead of the visitor's.
- Sending old CRM events more than seven days after they happened, so they are rejected.
- Only tracking the form fill for lead gen. If many of your leads never answer the phone, Meta will keep finding more people like them. Sending a "qualified" event from the CRM lets you optimise for better leads. Fast follow-up matters too – see speed to lead.
Running Meta lead form campaigns rather than website forms? Those leads are created inside Meta, so the pixel does not see them. You can still send later CRM stages back with the Conversions API. Our Facebook lead ads guide covers keeping that lead quality high.
12. FAQ
Is the Meta Pixel still needed if I use the Conversions API?
Yes, for most websites. Meta recommends using both together. The pixel captures browsing events and browser signals cheaply; the Conversions API makes key conversions reliable. Deduplication stops them being counted twice.
Is the Conversions API free?
Meta does not charge for the API itself. Your cost depends on the method: partner integrations are usually included with your platform, while the Gateway or server-side GTM need hosting, and a direct integration needs developer time.
How long does it take for events to show in Events Manager?
Test Events shows events within seconds to a few minutes. The Overview and Event Match Quality figures can take longer – often a day or more – to reflect a change.
What is a good Event Match Quality score?
Higher is better, and Meta shows the score with a rating band. Rather than chasing a number, make sure every key server event includes hashed email and phone, fbp, fbc, IP address and user agent. Those fixes usually lift the score.
Can I send phone call conversions?
Yes. Use action_source "phone_call" and send the event from your call tracking platform or CRM with the caller's hashed phone number. See call tracking 101 for how calls are tracked in the first place.
Next step: build tracking you can trust
Good tracking is what lets you judge every ad by real results instead of guesses. If you want to go from setup to profitable campaigns, start with our Meta Ads Mastery course, which covers campaign structure, creatives and scaling on top of this foundation. To connect Meta, GA4 and your CRM in one reporting flow, take Analytics, Tracking & Automation, and to make sure the page you are tracking actually converts, see Landing Pages & Lead Magnets.
Once your events are clean, run your numbers through the ROAS lab to find the return you need from each campaign.