Skip to content

Meta Pixel and Conversions API setup: a step-by-step guide for online stores

Set up the Meta Pixel and Conversions API step by step: which events to send, Shopify and WooCommerce setup, deduplication, testing and common fixes.

Meta Ads Copilot Max team9 min read
A person holding a bank card while paying on a laptop, the other hand on the keyboard

Photo: Bogdan Hoyaux / European Commission · CC BY 4.0, via Wikimedia Commons

A proper Meta Pixel and Conversions API setup is what lets Meta know that your ad turned into a sale. Without it, Ads Manager can show reach and clicks but not purchases, the Sales objective optimizes blind, and you cannot tell a profitable ad from an expensive one. This guide explains in plain words what each piece does, which events an online store needs, how to set them up on Shopify, WooCommerce and other platforms, how to avoid counting the same sale twice, and how to test everything before you spend a dollar.

In short: Install the Meta Pixel on every page and send at least ViewContent, AddToCart, InitiateCheckout and Purchase (with value and currency). Add the Conversions API so purchases still reach Meta when the browser blocks the pixel. Send both with the same event ID so Meta counts each sale once. Then place a test order, check it in Events Manager, and compare Meta's purchase count with your store's orders.

What the Meta Pixel does

The Meta Pixel is a small piece of JavaScript on your website. When someone visits a product page, adds to cart or completes a purchase, the pixel sends that event from their browser to Meta. Meta uses it to:

  • Show results like purchases and cost per sale in Ads Manager.
  • Optimize Sales campaigns toward people likely to buy.
  • Build custom audiences of site visitors and buyers for retargeting and exclusions.

The weak spot: it runs in the visitor's browser. Ad blockers, privacy settings, slow connections and pages that close too early can stop events from reaching Meta.

What the Conversions API does

The Conversions API (often called CAPI) sends the same events from your server or your store platform to Meta, instead of from the browser. Meta describes it in its developer documentation as a way to share website, app and offline events directly from your systems. Because it does not depend on the browser, it fills many of the gaps the pixel leaves.

Meta PixelConversions API
Runs inThe visitor's browserYour server or your platform's servers
SetupPaste code or connect an appUsually a platform integration; custom code otherwise
Blocked by ad blockers or browser settingsOftenNo
Best atOn-site behavior, quick setupReliable purchase and lead reporting
RecommendedYesYes, together with the pixel

Use both. The pixel captures browsing behavior well; the Conversions API makes sure the sales themselves arrive.

Close-up of a laptop screen with code in a dark editor, a person working at it
Most stores never touch code: Shopify and WooCommerce integrations install the pixel and the Conversions API for you.Photo: Tirza van Dijk tirzavandijk · CC0, via Wikimedia Commons

The events an online store should send

Meta has a list of standard events. For a store, these matter most:

EventWhen it firesWhy it matters
PageViewEvery page loadBasic traffic and audience building
ViewContentA product page is viewedProduct viewers for retargeting
AddToCartAn item is added to the cartStrong interest signal
InitiateCheckoutCheckout startsShows where buyers drop out
PurchaseThe order is completedThe result that pays the bills; include value and currency

Service businesses usually add Lead (form sent), Contact or Schedule (booking). Whatever you send, the Purchase event with the correct value and currency is the one to get perfect: it is what your cost per sale and "sold per $1 of ads" are calculated from.

Step-by-step setup

Step 1: create your pixel in Events Manager

  1. Open Events Manager from your Meta business tools.
  2. Connect a new data source and choose Web. Events Manager may call it a dataset; it is the same thing you use as your pixel.
  3. Name it after your store and add your website address.
  4. Note the ID. Most integrations find it for you, but it helps to know which one is yours, especially if an old pixel exists from a past agency.

Step 2: install it on your platform

Shopify. Install Meta's Facebook & Instagram sales channel app and connect your business assets. In the data-sharing settings, Shopify offers three levels: Standard uses only the pixel, while Enhanced and Maximum also use the Conversions API. Shopify explains the levels in its help article on Meta data sharing. For most stores, choose a level that includes the Conversions API. Our guide to Meta ads for Shopify covers the rest of the setup.

WooCommerce. Install the official Meta for WooCommerce extension and connect it to your business account. Its documentation notes that the Conversions API is integrated out of the box and that pixel and server events are deduplicated with a unique event ID. If you use a caching plugin, check that it does not stop pixel events from firing. More in our guide to Meta ads for WooCommerce.

Other platforms. Look first for a native Meta integration in your platform's settings or app store: many offer pixel and Conversions API in one connection. If there is none, Meta offers partner integrations and a Conversions API Gateway, or a developer can send events to the API directly.

Avoid double installs. If you paste the pixel code into your theme and connect an app, every event may fire twice. Use one method per event source.

Rows of server racks with blue status lights in a data center
The Conversions API sends sales from servers, not from the shopper's browser, so ad blockers and closed tabs no longer hide them.Photo: NOIRLab/NSF/AURA/T. Slovinský · CC BY 4.0, via Wikimedia Commons

Step 3: make sure each sale is counted once (deduplication)

When both pixel and Conversions API send the same Purchase, Meta needs to know it is one sale. Meta's guide to handling duplicate pixel and Conversions API events recommends sending the same event name and the same event ID from both. Meta then keeps one and drops the duplicate, as long as they arrive within 48 hours of each other.

Shopify's and WooCommerce's official integrations handle this for you. Custom setups must generate one event ID per order (the order number works well) and send it from both sides.

Step 4: test before you spend

  1. Open Test events in Events Manager and enter your store's address.
  2. Browse a product, add it to the cart and start checkout. You should see ViewContent, AddToCart and InitiateCheckout arrive, marked as coming from the browser, the server, or both.
  3. Place a real test order (a cheap product or a 100% discount code, then refund it). Check that one Purchase appears with the right value and currency.
  4. Install the Meta Pixel Helper Chrome extension to see which pixel fires on each page and spot duplicates or a second, forgotten pixel.

Step 5: check data quality after a few days

In Events Manager, look at each event's overview:

  • Event match quality, a score out of 10 that shows how well Meta can match events to people. Server events with more customer details (sent in hashed form by the integration) usually score higher.
  • Deduplication: the share of browser and server events that were matched.
  • Warnings about missing parameters, wrong currency codes or a domain that is not verified.

Then compare a week of Meta purchases with your store's orders. They will never match exactly (some buyers never saw an ad, and attribution windows differ), but a gap of half or double means something is broken.

Hands typing on a laptop on a clean white desk next to a dark mug
Ten minutes of testing with a real order saves weeks of judging ads on numbers that were never right.Photo: Thomas Lefebvre imthebear · CC0, via Wikimedia Commons

The pixel and the Conversions API process personal data about your visitors. Depending on where you and your customers are, you may need a cookie banner, consent before tracking, and a privacy policy that mentions Meta. Use your platform's consent tools and check your local rules; this guide is not legal advice.

What if…? Common tracking problems

What if Ads Manager shows twice as many purchases as your store? Classic duplication: the pixel is installed twice, or pixel and server events lack a shared event ID. Use Pixel Helper and the deduplication view in Events Manager to find which.

What if purchases never appear, but add to cart does? The Purchase event usually fires on the thank-you page. If buyers pay on an external page (some payment providers redirect elsewhere) and never return to your site, the browser event never fires. The Conversions API, which sends from the order itself, solves most of this.

What if the purchase value is wrong? Check the currency code (USD, MXN, COP…) and whether the value includes shipping and tax the way you want. A value in cents sent as dollars makes your results look absurd.

What if Events Manager says "no recent activity"? The pixel may be disconnected after a theme change, an app reinstall or an expired integration token. Reconnect, then repeat the test order. Our troubleshooting guide for a Meta pixel that is not tracking sales goes through each cause.

What if you inherited an old pixel from an agency? Check which pixel your ad account and your store actually use. Ask for access rather than creating a new one if it holds years of data; a new pixel starts with no history for audiences.

Why this matters for your ad decisions

With reliable tracking you can use the Sales objective (see our guide to Meta campaign objectives), build retargeting audiences, and compare each campaign's cost per sale with your margin. Without it, you are guessing. That last comparison is the one that decides whether an ad stays on; our guide to the break-even cost per sale shows how to calculate the number to compare against.

How Meta Ads Copilot Max helps

Meta Ads Copilot Max does not install the pixel for you; your store platform does that best. What it does is watch whether tracking is working and keep your decisions honest:

  • When it reads your campaigns in Ads Manager and sees that no purchase tracking is connected, it raises a "No purchase tracking" alert so you fix it before judging any ad.
  • It reads the purchases your pixel reports and compares cost per sale with your margin.
  • When Meta suggests switching to conversion-based optimization but no purchases are being tracked, Copilot marks that tip "not for you yet": it needs tracking and steady sales first.
  • Fixes are done by the Claude in Chrome extension in your own browser, and nothing is published or spends money without your approval.

Want it watching your account? Start your free 7-day trial.

Frequently asked questions

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

Meta recommends using them together. The pixel captures browsing behavior easily; the Conversions API makes purchase reporting more reliable when browsers block the pixel. With proper deduplication, using both does not double-count sales.

Is the Conversions API hard to set up?

On Shopify and WooCommerce it is mostly a setting in the official integration. On custom sites it needs a developer, a partner integration or Meta's Conversions API Gateway.

How do I know if my pixel is working?

Use Test events in Events Manager while you browse and place a test order, and install the Meta Pixel Helper Chrome extension. Then compare a week of Meta purchases with your store's orders.

Why does Meta report a different number of sales than my store?

Meta counts purchases it can attribute to ads within its attribution window, while your store counts every order. Some difference is normal. Large gaps usually mean duplicate events, missing purchase events or the wrong pixel.

Does the Meta Pixel slow down my website?

The pixel script is small and loads asynchronously, so its impact is usually minor. Installing several pixels or tracking apps at once can add up, which is another reason to use one clean integration.

  • meta pixel
  • conversions api
  • events manager
  • purchase tracking

Try Meta Ads Copilot Max free for 7 days

Every feature, on your own store. Enter your email and we send you the key and the download link. Requires the Claude in Chrome extension.

We email you a 7-day trial key. No credit card, nothing to cancel.

Keep reading

All articles