Performance Marketing · Guide

Meta Pixel and Conversions API: How to Set Up Tracking Properly

How the Meta Pixel and Conversions API work together, which setup route suits your site, how deduplication works and how to check your tracking is right.

Meta Events Manager style overview showing Pixel and Conversions API events deduplicated with event_id and a match quality score
Key takeaways
  • The Meta Pixel tracks actions in the browser, while the Conversions API sends the same actions from your server.
  • Run both together and give each action the same event_name and event_id so Meta counts it once.
  • Event Match Quality is scored from 0 to 10; hashed email and phone add the most matching signal.
  • Meta optimises towards the actions you send it, so broken tracking means it optimises for the wrong people.
On this page

Most businesses that tell us "Meta Ads are not working" have the same hidden problem. The dashboard shows clicks and leads, but the numbers do not match what the sales team sees, and Meta keeps finding people who never buy.

The cause is usually tracking. Meta's delivery system learns from the actions you send it. If those signals are missing, duplicated or attached to the wrong event, the algorithm optimises for the wrong people. This guide explains how to set up the Meta Pixel and the Meta Conversions API together so Meta sees the right actions, counted once. It is part of our complete guide to performance marketing.

What the Pixel and the Conversions API each do

The Meta Pixel is a piece of JavaScript on your website. When someone views a page, submits a form or completes a purchase, the Pixel sends that event from their browser to Meta.

The Conversions API (often shortened to CAPI) sends the same kind of event from your server, or from a platform such as Shopify, directly to Meta. Because it does not depend on the visitor's browser, it keeps working when cookies are blocked, scripts are stopped by an ad blocker or a page closes before the Pixel fires.

Meta Pixel Conversions API
Where it runs The visitor's browser Your server, platform or a hosted gateway
Affected by ad blockers and browser limits Yes No
Can send offline and CRM events No Yes
Setup effort Low Low to high, depending on the route
Needed in 2026 Yes Yes

They are not alternatives. Meta recommends running both, so the server fills the gaps the browser leaves.

Why browser tracking alone is no longer enough

Browser privacy changes have steadily reduced what a Pixel can see. Apple's App Tracking Transparency, Safari's tracking prevention, shorter cookie lifetimes and ad blockers all mean a share of real conversions never reach Meta through the browser.

When Meta sees fewer conversions than really happened, two things go wrong. Your reported cost per lead looks worse than it is, and the delivery system has less data to learn who converts. The Conversions API restores that signal.

Choose a setup route

There are four common ways to send server events. The right one depends on your platform and how much control you need.

Route How it works Effort Suits
Partner integration Built into Shopify, WooCommerce and many CRMs; switch it on and connect your dataset Low Most online stores and small businesses
Conversions API Gateway Meta's gateway software, set up in a cloud account you own, such as AWS or Google Cloud Medium Teams that want server events without building a server container
Server side Google Tag Manager One server container sends events to Meta, Google and others Medium to high Businesses running ads on several platforms
Direct API integration Developers send events from your backend High Custom platforms and complex funnels

For a Shopify store, the partner integration is usually the right start: in the Facebook and Instagram sales channel, set data sharing to the maximum level so both browser and server events are sent. For a custom built lead generation site, server side Tag Manager or the gateway gives more control over what is sent.

Comparison of four Meta Conversions API setup routes by effort, control and the businesses each one suits
Four ways to send Conversions API events, from a partner integration to a direct API build.

Step by step: setting up the Pixel and Conversions API

1. Create or confirm your dataset in Events Manager

In Meta Events Manager, your Pixel now sits inside a dataset that holds web, app, offline and CRM events together. Confirm you have one dataset for the business and that it is connected to the right ad account.

2. Decide which events matter

Track the actions that represent business value, using Meta's standard event names so the system understands them:

  • Lead when a form is submitted
  • Contact when someone taps to call or opens WhatsApp
  • Schedule when an appointment is booked
  • CompleteRegistration for sign ups
  • AddToCart, InitiateCheckout and Purchase for online stores

Fire Lead on the thank you page or the actual submit event, never on page load of the form page. Firing it too early is one of the most common reasons lead numbers look inflated.

3. Add the server events

Switch on the partner integration, deploy the gateway or configure your server container, then send the same events from the server.

4. Deduplicate with event_id

When both the browser and the server send the same purchase, Meta needs to know it is one purchase, not two. It matches on the combination of event_name and event_id. Generate one ID per action and pass it to both:

<script>
  // browser event
  fbq('track', 'Lead', {}, { eventID: 'lead_8F3K2Q' });
</script>
{
  "data": [{
    "event_name": "Lead",
    "event_time": 1793500000,
    "event_id": "lead_8F3K2Q",
    "action_source": "website",
    "event_source_url": "https://example.com/thank-you",
    "user_data": {
      "em": ["<SHA256 hashed email>"],
      "ph": ["<SHA256 hashed phone>"],
      "client_user_agent": "<browser user agent, not hashed>"
    }
  }]
}

If the IDs do not match, Meta counts the conversion twice, and your cost per lead looks better than it really is.

5. Send customer information parameters

Server events are matched to Meta accounts using customer information. The most useful are a hashed email and a hashed phone number, followed by the fbp and fbc cookie values, IP address and user agent. Partner integrations hash these automatically; a custom build must hash email and phone with SHA256 before sending.

6. Test before you spend

Use the Test events tab in Events Manager. Submit your own form, then check that the event arrives from both the browser and the server and shows as deduplicated.

7. Check Event Match Quality

Events Manager scores how well your server events match Meta accounts on a scale of 0 to 10. A low score usually means you are not sending email or phone. Adding them is the quickest improvement.

Diagram of a browser and server event sharing one event_id so Meta counts one lead, beside a tracking checklist
The tracking checks to run in Events Manager before you spend on a campaign.
Free ad account audit

Spending on ads but not getting leads?We review your Meta and Google Ads setup, tracking, audiences and landing pages, then show you where the budget is leaking.

Get my free ad account audit →

What changed with Aggregated Event Measurement

For several years, advertisers had to verify their domain and rank up to eight web events in priority order. Meta has since removed the need to prioritise events and the event configuration requirement tied to domain verification. Aggregated Event Measurement still exists in the background, but you no longer manage that ranking yourself.

Domain verification is still worth doing in Business Settings, because it proves you own the links in your ads.

Go beyond the form: send CRM events

For lead generation, a form submission is only the start. The events that matter are a qualified lead, a booked meeting and a sale. With the Conversions API you can send those stages back from your CRM, which lets Meta optimise for people who become customers, not just people who fill forms. We explain this in how to fix junk leads from Meta lead forms.

Common tracking mistakes

Mistake What happens Fix
Lead fires on page load Every visitor counts as a lead Fire on submit or the thank you page
No event_id on server events Conversions counted twice Pass the same ID to browser and server
Pixel installed twice Duplicate page views and events Remove the theme or plugin duplicate
No email or phone sent Low Event Match Quality Send hashed customer information
Wrong dataset connected Ads optimise on another site's data Check the dataset in ad set settings

Do not forget consent. India's Digital Personal Data Protection Act will govern the personal data you collect and share once its notice and consent duties take effect in May 2027, and visitors from the EU need consent before tracking. Tell people what you collect in your privacy policy and respect their choices.

What fixing tracking looks like in practice

A fashion and D2C brand came to us spending on Meta with plenty of activity in the dashboard that was not turning into business results. Correcting the account structure and conversion tracking came first, before any change to creative or budget. See the fashion D2C Meta Ads case study.

If you also run Google Ads, set up the matching side using our guide to Google Ads conversion tracking with GA4. Once tracking is right, campaign decisions get easier, from lead generation campaigns to retargeting. And if you want to see how AI assistants send traffic too, read how to track AI assistant traffic in GA4.

Want a second pair of eyes on your setup? Request a free ad account audit and we will check your Pixel, Conversions API and events line by line. You can also explore our performance marketing services.

Frequently asked questions

Yes. Meta recommends running both. The Pixel captures browser signals such as page views and cookies that help matching, while the Conversions API fills the gaps when the browser cannot send an event.

The API itself is free to use. Costs come from the setup route: partner integrations are usually included with your platform, while server side Tag Manager or the gateway may involve hosting costs and developer time.

Higher is better, and the score runs from 0 to 10. If yours is low, the usual fix is sending hashed email and phone numbers with your server events. Aim to improve it steadily rather than chasing a perfect score.

Common causes are duplicate events without a matching event_id, a Lead event firing on page load, spam submissions and attribution windows. Meta also reports conversions within its attribution window, which can differ from the day a lead appears in your CRM.

You can track the tap to call or tap to WhatsApp as a Contact event in the browser. To count conversations that turn into real leads, record them in your CRM and send them back through the Conversions API.

Lakshay Kr. Bhatnagar

Founder, BrandMates Studio

Lakshay has spent more than eight years in SEO, answer engine and generative engine optimisation, performance marketing and content strategy, working with brands across India, the Netherlands, the US, Canada, New Zealand and Malaysia. He founded BrandMates Studio in 2025.

Let's map your route.

Tell us where your brand needs to go. We'll come back with a free audit, a plan and a realistic timeline, usually within two working days.

Get a free audit Call