Meta Pixel and Conversions API Setup: Track Ads Properly on Facebook and Instagram
Set up the Meta Pixel and Conversions API step by step, choose the right events, stop double counting with event IDs and raise Event Match Quality.

Quick answer
The Meta Pixel is code on your website that tells Meta which visitors from Facebook and Instagram ads took actions such as leads or purchases. The Conversions API sends the same events from your server, which recovers events that browsers block. Set up both, send the same event name and event ID from each so Meta removes duplicates, include customer details like email and phone to improve matching, and verify everything in Events Manager.
If you run ads on Facebook or Instagram, the Meta Pixel and the Conversions API decide how much Meta knows about your results. Without them, Meta optimises for clicks and you guess which ads bring customers. With them set up properly, Meta can find more people like your actual buyers, and your reports show real cost per lead or sale.
This guide covers Meta Pixel setup, adding the Conversions API, choosing events, removing duplicates and checking quality, in the order we do it for clients.
Pixel and Conversions API: what is the difference?
| Meta Pixel | Conversions API (CAPI) | |
|---|---|---|
| Where it runs | In the visitor's browser | On your server or platform |
| How it sends data | JavaScript on your pages | Server-to-server connection |
| Blocked by ad blockers and browser privacy? | Often | No |
| Setup | Paste code or use an integration | Platform integration, gateway or developer |
| Best used | Together with CAPI | Together with the Pixel |
Meta recommends using both. The Pixel captures browsing behaviour in real time; the Conversions API fills the gaps when the browser does not send the event.
Step 1: Create your dataset (Pixel) in Events Manager
- Open Meta Events Manager from your Business Portfolio.
- Choose Connect data sources, then Web.
- Name it after your website and create it. Meta calls the container a dataset; the Pixel is its web connection.
- Make sure it is owned by your business portfolio, not a freelancer's personal account, so you keep it if people change.
Step 2: Install the Pixel
Choose the easiest method for your site:
- Shopify: install the Facebook and Instagram channel app and connect your dataset. Choose the maximum data-sharing level to enable the Conversions API too.
- WooCommerce / WordPress: use Meta's official plugin, which can send both Pixel and server events.
- Wix, Squarespace and similar: use the built-in marketing integration and paste your dataset ID.
- Custom websites: paste the Pixel base code in the head of every page, or load it through Google Tag Manager.
Install it once. Two Pixels firing on the same page inflate every number.
Step 3: Choose the events that matter
Meta has standard events with fixed names. Use them, rather than inventing names, so Meta's optimisation understands them.
| Business | Events to track |
|---|---|
| Lead generation (clinics, B2B, services) | Lead on form submission, Contact on call or WhatsApp click, Schedule for bookings |
| E-commerce | ViewContent, AddToCart, InitiateCheckout, Purchase with value and currency |
| Education | Lead for enquiries, SubmitApplication for applications |
| Content and community | CompleteRegistration for sign-ups |
Fire Lead only when the form submits successfully, not when the form page loads.
If you use Meta's instant forms instead of your website, leads are recorded inside Meta automatically. Our guide to Facebook lead ads covers that route.
Step 4: Add the Conversions API
Pick the route that suits your setup:
- Platform integration (easiest). Shopify, WooCommerce and many builders send server events once you connect the dataset with full data sharing.
- Conversions API Gateway. A Meta-provided server you host in your own cloud account, which mirrors Pixel events to the server without much coding.
- Server-side tagging. If you already use Google Tag Manager's server-side container, add Meta's Conversions API tag there.
- Direct integration. Your developer sends events from your backend, for example when a form is saved in your CRM.
Step 5: Deduplicate with event IDs
When both the Pixel and the Conversions API send the same purchase, Meta must know it is one purchase, not two. It decides by matching the event name and the event ID.
- Generate one unique ID for each action, such as the order number or a random ID created when the form is submitted.
- Send it as
eventIDwith the Pixel event and asevent_idwith the Conversions API event. - Use exactly the same event name on both sides (
PurchaseandPurchase, notPurchaseandpurchase_complete).
Meta's developer documentation on handling duplicate Pixel and Conversions API events explains the rules in detail. Platform integrations usually handle this for you, but check it in Events Manager.
Step 6: Improve Event Match Quality
Event Match Quality (EMQ) is a score from 1 to 10 shown for each event in Events Manager. It reflects how well the customer information you send lets Meta match the event to a person.
To raise it, send these customer details with server events where you have them and have consent:
- Email address and phone number (in international format such as +91), hashed before sending; most integrations hash automatically
- First and last name, city, state and postal code
- An external ID, such as your customer ID
- The browser identifiers
fbpandfbcfrom the visitor's cookies - The visitor's IP address and user agent
Meta's Conversions API best practices recommend including an external ID and event ID with every event. Mention this data use in your privacy policy.
Step 7: Test everything
- In Events Manager, open Test events, enter your website URL and browse your site in the window that opens.
- Submit a test form or test order. You should see the event arrive from both Browser and Server, and appear as deduplicated.
- Install the Meta Pixel Helper browser extension to check the Pixel on each page.
- After a day, check Overview for each event: volume, deduplication and Event Match Quality.
Step 8: Use the data in your ads
- Set your campaign's optimisation event to the action you want more of, usually
LeadorPurchase. - Build custom audiences of site visitors and people who took key actions, and lookalike audiences from your best customers.
- Exclude existing customers from acquisition campaigns.
- Compare cost per result in Ads Manager with leads in your CRM. If they differ a lot, check your tracking or lead quality.
Add UTM parameters to your ad links too, so Google Analytics can compare Meta with your other channels. Our UTM parameters guide includes Meta's dynamic URL values.
Common Pixel and CAPI mistakes
- Firing
Leadon page load instead of successful submission - Two Pixels or two installs of the same Pixel
- Missing event IDs, so server and browser events double count
- Custom event names where a standard event exists
- Personal ownership of the dataset by a former freelancer or agency
- Never rechecking after a website change, when forms or checkouts are rebuilt
Accurate tracking is the foundation of profitable Instagram ads and Facebook campaigns. If you would like your Meta tracking audited and your campaigns run against real leads and sales, see our performance marketing service.
Work with us
Performance Marketing from The Coral Flow
Get a free ad account audit. Give us view access. We review your campaigns, tracking and creatives and send the leaks costing you the most.
Frequently asked questions
Is the Facebook Pixel the same as the Meta Pixel?
Yes. Facebook renamed itself Meta in 2021 and the Facebook Pixel became the Meta Pixel. It tracks visitors from both Facebook and Instagram ads.
Do I need the Conversions API if I have the Pixel?
It is strongly recommended. Ad blockers, browser privacy features and app in-app browsers stop a share of Pixel events. The Conversions API sends events from your server, so Meta sees more of your real results and optimises better.
What is Event Match Quality?
A score from 1 to 10 in Events Manager that shows how well the customer details you send help Meta match events to its users. Higher scores usually mean better attribution and optimisation. Meta generally suggests aiming for 6 or above.
How does Meta remove duplicate events?
When the Pixel and Conversions API send the same event with the same event name and the same event ID, Meta keeps one and discards the other. Without a shared event ID, events can be counted twice.
Can I set up the Conversions API without a developer?
Often yes. Shopify, WooCommerce and many website builders have Meta integrations that set up both the Pixel and Conversions API. Custom websites usually need a developer or a server-side tagging setup.
Written by
Parves, Founder and Creative Director
Leads strategy and creative direction at The Coral Flow in Chennai, across web, search and content for brands in India and abroad.


