Meta pixel and Conversions API: a setup guide for online stores
The Meta pixel tracks visitor actions in the browser, while the Conversions API sends the same events directly from your server to Meta. Using both, with proper deduplication, gives Meta more complete purchase data, which improves optimisation and reporting. For an online store, correct tracking of purchases and their value is the foundation of every profitable Meta campaign.
What is the Meta pixel?
The Meta pixel is a piece of code on your website that records what visitors do: view a page, view a product, add to cart, start checkout and purchase. It sends these events to Meta, which uses them to report results, build audiences for retargeting and, most importantly, optimise campaigns towards people likely to buy.
The pixel runs in the visitor's browser, which is its weakness. Ad blockers, browser privacy features, slow pages and cookie refusals can stop events from reaching Meta.
The pixel also sets cookies that help Meta connect a visit to a person who saw or clicked an ad. When those cookies are blocked or deleted, Meta loses part of the link between an ad and the purchase that followed.
What is the Conversions API?
The Conversions API (CAPI) sends events from your server or platform directly to Meta, without relying on the browser. Because it does not depend on the visitor's browser, it can capture events the pixel misses and can include customer information, such as a hashed email, that helps Meta match the event to a person.
Meta recommends using the Conversions API together with the pixel, not instead of it.
Customer information sent through the Conversions API, such as email, phone number or address, is hashed before it reaches Meta. Meta uses it only to match the event to a Meta account, which improves attribution and optimisation. More matched events mean more of your real purchases count towards campaign learning.
Why do you need both?
- More complete data: the server catches events the browser loses.
- Better optimisation: Meta's delivery system learns from purchases. More reliable purchase data means it can find buyers more efficiently.
- Better reporting: fewer missing purchases means ROAS and cost per purchase in Ads Manager are closer to reality.
- Better audiences: retargeting and lookalike audiences are built on more complete event data.
Poor tracking is one of the most common reasons Meta ads look unprofitable. Read what a good ROAS is to see why accurate purchase value matters.
Tracking problems are often invisible. Ads still run and Ads Manager still shows numbers, but the numbers are incomplete and optimisation suffers quietly. That is why tracking should be checked before any decision to scale or pause campaigns.
Which events should an online store track?
- PageView: every page load.
- ViewContent: product page views, with product ID and value.
- AddToCart: with product ID, value and currency.
- InitiateCheckout: when checkout begins.
- AddPaymentInfo: optional, useful for spotting checkout drop-off.
- Purchase: with order value, currency and product IDs. This is the most important event.
If you use a product catalogue for dynamic ads, product IDs in events must match the IDs in the catalogue.
Every event should include the correct currency, and the Purchase value should match what your store reports: decide whether it includes VAT and delivery and stay consistent. Mismatched values make ROAS comparisons between Meta and your store unreliable.
Track events consistently across all language and country versions of your store. If you sell in several markets, missing events on one version distort results for that country.
How do you set it up on Shopify and WooCommerce?
Shopify
Install Meta's official Facebook and Instagram sales channel app, connect your Business account, ad account, pixel and catalogue, and set data sharing to the maximum level available. This enables both the pixel and the Conversions API without custom code.
WooCommerce
Use Meta's official integration for WooCommerce or a well maintained tracking plugin that supports the Conversions API. Alternatively, use Google Tag Manager with a server-side container for more control. Whatever you choose, avoid installing the pixel twice through different plugins, which causes double counting.
Other platforms
Many platforms have a native Meta integration. Where they do not, the Conversions API can be connected through a partner integration, server-side Tag Manager or a direct API connection.
If you also use GA4 and Google Ads, consider managing all tags through Google Tag Manager. One container for all tracking makes it easier to keep events consistent across platforms and to respect cookie consent in one place.
What is deduplication and why does it matter?
When the pixel and the Conversions API both send the same purchase, Meta needs to know it is one purchase, not two. This is done with deduplication: both events carry the same event name and the same event ID. Without it, purchases can be counted twice and ROAS looks better than it is.
Official platform integrations usually handle this automatically. Custom setups need to pass the event ID consistently.
A second deduplication issue is double installation. Stores that switch themes, plugins or agencies sometimes end up with the pixel installed in two or three places. Use the Meta Pixel Helper browser extension to check how many pixels fire on your product and thank you pages.
How do you check that tracking works?
- Open Events Manager and check that events arrive from both the browser and the server.
- Use the Test Events tool and make a test purchase.
- Check the deduplication status and the Event Match Quality score for the Purchase event.
- Compare purchases in Meta with real orders in your store for the same period. Some difference is normal because of attribution settings and consent, but large gaps point to a problem.
- Check that purchase value and currency are correct, especially if you sell in several currencies.
Repeat these checks after every major change to your store: a new theme, checkout app, payment provider or consent tool can break tracking without anyone noticing until results drop.
What about GDPR and cookie consent?
In the EU, tracking for advertising needs a lawful basis, which for most stores means a cookie consent banner. Configure your consent tool so that the pixel and Conversions API respect the visitor's choice. Consent rules affect how much data you can collect, so it is worth getting legal advice on your setup. This guide is not legal advice.
Consent also explains part of the gap between Meta numbers and real orders. Visitors who refuse advertising cookies may still buy, but the purchase cannot always be linked to an ad. Account for this when comparing Meta reports with store data.
What is the next step?
Open Events Manager today and check three things: are Purchase events arriving from both browser and server, is deduplication working, and do the numbers match your real orders? If any answer is no, fix tracking before increasing ad spend. COR Agency sets up and checks the Meta pixel, Conversions API, GA4 and Tag Manager as part of our Meta ads management, and we can look at your account in a free analysis within 24 hours.
Not sure your pixel and Conversions API work? Get a free analysis of your Meta ads within 24 hours.
Frequently asked questions
Yes. Meta recommends using both together, with deduplication, because each captures events the other can miss.
Meta does not charge for using the Conversions API. Costs can come from the plugin, server hosting or setup work, depending on your platform.
Common reasons are ad blockers, cookie refusals, attribution windows and missing server events. Adding the Conversions API usually narrows the gap.
Often because of missing deduplication or a pixel installed twice, so the same purchase is counted more than once.
Higher is better. Meta shows the score per event in Events Manager and suggests which customer parameters to add to improve it.