How to set up the Meta Pixel and Conversions API

By AdsGrow team

Published · 6 min read

Join the waitlist
Clay illustration of a web page connected by a green cable to a small server, with signals travelling along the cable

To complete a Meta Pixel and Conversions API setup, install the Pixel on every page of your site, then send the same key events from your server with the Conversions API. Give each event the same event name and event ID in both places so Meta can remove duplicates. Then use Events Manager to test each event and check Event Match Quality before you put money behind a campaign. If you have only ever heard it called the Facebook pixel, this is the same tool under its current name.

Key takeaways

  • Use one Pixel for the business and install its base code on every page.
  • Track only the two to four actions that matter, such as Purchase or Lead, with value and currency on purchases.
  • Connect the Conversions API through a partner integration, the Conversions API Gateway or a direct build.
  • Share an event ID between browser and server so each sale counts once.
  • Test every event in Events Manager before you launch.

What do the Meta Pixel and Conversions API each do?

The Meta Pixel is a piece of code on your website that sends events, such as a page view or a purchase, from the visitor’s browser to Meta. The Conversions API (often called CAPI) sends events from your server to Meta instead. Using both gives Meta a fuller picture of what people do after they see your ads.

Meta Pixel Conversions API
Where it runs In the visitor’s browser On your server or platform
What it catches Page views, clicks and on-site actions Sales, leads and actions confirmed by your system, including ones that happen later or offline
What can stop it Ad blockers, browser privacy limits, cookie consent choices, slow pages Broken integrations, missing data, wrong setup

Browser events alone miss some actions. Server events alone lose some browser context. Together, with duplicates removed, they give Meta better data to optimize your campaigns.

What you need before you start

  • Admin access to your Meta business portfolio (Business Manager) and Events Manager.
  • Access to your website or store admin, or to your tag manager.
  • A short list of the two to four actions that matter, for example Purchase, Lead or CompleteRegistration.
  • A developer, or a store or CMS platform with a Meta partner integration, for the server side.

How to set up the Meta Pixel and Conversions API step by step

Menus in Meta’s tools move often, so treat the paths below as a guide and follow the labels you see on screen.

Step 1: Create or pick one Pixel

In Events Manager, Pixels now appear as datasets. Check whether your business already has one before you create a new one. Use a single Pixel for one website. Several Pixels on the same site split your data and make reports hard to trust.

Step 2: Install the base code on every page

The base code records page views and loads the Pixel so other events can fire. You can install it in three ways: paste it into your site’s header, add it through a tag manager such as GTM (Google Tag Manager), or switch on your store or website platform’s Meta integration. Pick one method. Installing it twice, for example by plugin and by hand, fires every event twice.

Step 3: Choose standard events for the actions that matter

Meta has standard events with fixed names, such as Purchase, Lead, AddToCart and CompleteRegistration. Use these where they fit, because Meta’s delivery system understands them. For a purchase, always send the value and currency parameters, so Meta can report revenue and optimize for higher-value sales.

Step 4: Connect the Conversions API

There are three common routes:

Route Effort Who it suits What to check
Partner integration in your store or CMS Low Most small stores and sites on popular platforms Which events it sends and whether it deduplicates with the Pixel
Conversions API Gateway Medium Teams that want server events without writing code, and can manage a cloud setup Hosting cost and who maintains it
Direct integration High Custom sites or apps with developer time Event names, parameters and error handling

If your platform offers a partner integration, start there. It is usually the fastest path and often handles deduplication for you.

Step 5: Deduplicate browser and server events

When the Pixel and the Conversions API both report the same purchase, Meta needs a way to tell they are one event. Send the same event_name and a shared event_id from both sides. The event ID can be your order number or another value unique to that action. Without it, each sale can be counted twice. Your reported cost per purchase then looks better than it really is, and Meta optimizes on false data.

Step 6: Send customer information parameters

Server events can include customer information such as email address, phone number, name and city, plus the browser and click IDs the Pixel sets. Meta uses these to match events to its accounts. Hash personal fields such as email and phone in the way Meta’s documentation specifies before you send them. Collect and send customer data only with the consent your local law requires.

Step 7: Test every event before launch

Open the Test Events tool in Events Manager. Visit your site, then trigger each key event yourself: view a product, add to cart, complete a test purchase or submit a lead form. Confirm that each event arrives from both the browser and the server, shows the right value and currency, and is marked as deduplicated. Fix anything missing before you spend.

What is Event Match Quality and how do you raise it?

Event Match Quality is Meta’s score for how well the customer information on your server events matches Meta accounts. Events Manager shows it per event, as a score out of 10 with a label. Better matching helps Meta connect a sale to the person who saw your ad, which feeds both reporting and optimization.

You raise it by sending better data rather than by changing settings:

  • Send more of the parameters you already collect legitimately, such as email and phone on a purchase.
  • Send them on every event where you have them, not only on some.
  • Format and hash them exactly as Meta documents, for example lowercase and trimmed email addresses before hashing.
  • Pass the browser and click IDs from the Pixel to your server events.

There is no single score to aim for. Watch the trend after each change, and use Meta’s best practices page as your reference.

A pre-launch tracking checklist

Copy this list and tick it off before your first campaign goes live:

  • One Pixel on the site
  • Base code on every page, installed once
  • Key events fire once per action
  • Value and currency sent with every Purchase
  • Server events arriving in Events Manager
  • Deduplication working for each key event
  • Event Match Quality checked and noted
  • The campaign optimizes for the event you want, such as Purchase or Lead

Common mistakes to avoid

  • Two Pixels on one site. Data splits and some events fire twice.
  • Purchase firing on page reload. If the thank-you page reloads, the sale counts again. Fire the event once per order.
  • No event ID. Browser and server copies both count, so results look inflated.
  • Optimizing for the wrong event. PageView or AddToCart is easier to get than a sale, so Meta finds people who browse but rarely buy.
  • Testing only the browser. Always check that server events arrive too.

Where AdsGrow fits

AdsGrow is built to check your tracking before a campaign goes live. When it reviews a Meta account, it looks at your Pixel and Conversions API events, checks that the key events arrive and are deduplicated, reviews Event Match Quality, and flags any gaps in plain words. AdsGrow does not install code on your site. You or your developer fix what it flags, and it checks again. Once tracking is clean, it drafts the campaign plan for your approval. You can read more about AdsGrow for Meta ads.

Next steps

With tracking tested, structure your first Meta campaign around the event you care about. Once it is running, start testing Meta ad creative one variable at a time.

Frequently asked questions

Do I need both the Meta Pixel and the Conversions API?

Meta recommends using both. The Pixel records what happens in the browser, and the Conversions API sends the same events from your server, so you still get the data when a browser blocks or limits the Pixel.

How do I stop Meta counting the same purchase twice?

Send the same event name and the same event ID from the Pixel and from the Conversions API for each action. Meta then treats the two as one event and keeps a single copy.

What is a good Event Match Quality score?

Meta shows Event Match Quality as a score out of 10 with a label, per event, in Events Manager. There is no fixed target worth chasing. Aim to raise it over time by sending more of the customer information you collect with consent.

Can I set up the Conversions API without a developer?

Often, yes. Many store and website platforms offer a partner integration that connects the Conversions API in a few clicks. A direct integration built from scratch usually needs a developer.

How long after setup should I wait before launching a campaign?

Launch once the Test Events tool shows each key event arriving from both browser and server, deduplicated, with the right values. Many owners also let real events flow for a few days first to confirm the counts match their store or CRM.

Sources

Let AdsGrow handle the day-to-day of your ads

Campaign setup, copy, pacing and plain-English reports for Meta, Reddit and Google. You approve anything big.