How to set up the Meta (Facebook) Conversions API for WooCommerce
The Meta Pixel tracks purchases from the visitor's browser, but ad blockers, privacy settings and slow connections cause many events to be lost. The Conversions API (CAPI) sends the same events from your server directly to Meta, so your ads get more complete data. This guide shows you how to set up the Meta Conversions API for WooCommerce, test it and avoid double counting.
Before you start
- A working Meta Pixel (dataset) in Events Manager. If you do not have one yet, start with how to add the Meta Pixel to WooCommerce and test it.
- Admin access to your Meta Business account and to WordPress.
- Your store on a domain verified in Meta Business settings.
Method 1: the official Facebook for WooCommerce plugin
- In WordPress, go to Plugins → Add New and install Facebook for WooCommerce (by Meta).
- Open its settings under the WooCommerce or Marketing menu and click to connect.
- Log in with Facebook and choose your business, Page, ad account, catalog and Pixel.
- Finish the connection. The plugin sends browser Pixel events and matching server events through the Conversions API.
- In the plugin settings, check that advanced matching or customer data sharing is enabled if you want better match quality.
Method 2: a tracking plugin with CAPI support
Plugins such as PixelYourSite or Pixel Manager for WooCommerce also support the Conversions API.
- In Events Manager, open your dataset, go to Settings and generate a Conversions API access token.
- Paste the Pixel ID and the token into the plugin's Meta settings.
- Make sure the plugin sends both browser and server events with the same event ID.
Use only one source
If you install Facebook for WooCommerce and another tracking plugin, or also paste the Pixel code into the theme, each purchase may be counted two or three times. Choose one solution and remove the others.
How deduplication works
For each event, the browser Pixel and the server send the same event name (for example Purchase) and the same event ID. Meta keeps one and discards the duplicate. Good plugins do this automatically; you only need to check it in testing.
Test your setup
- In Events Manager, open your dataset and the Test events tab.
- Copy the test code and enter it in your plugin's test field if it has one, or open your site from the browser test link.
- Browse a product, add it to the cart and place a test order.
- Check that
ViewContent,AddToCart,InitiateCheckoutandPurchaseappear from both Browser and Server, and are marked as deduplicated. - Remove the test code from the plugin afterwards, and cancel the test order.
After a day or two, check the Event Match Quality score in the Overview tab. Sending email and phone (hashed by the plugin) improves it.
Common problems
- No server events: the token is wrong or expired, or the connection was removed. Reconnect the plugin.
- Purchases doubled: two plugins or theme code are sending events, or event IDs do not match.
- Purchase missing for some orders: some payment gateways do not return customers to the thank-you page. Plugins that send the server event when the order is created or paid handle this better.
- Events delayed: server events can appear in Events Manager a little later than browser events.
Frequently asked questions
Do I still need the Pixel if I use CAPI?
Yes. Meta recommends using both together, with deduplication, for the most complete data.
Is it legal to send customer data to Meta?
The data is hashed before it is sent, but you should still mention tracking in your privacy policy and follow the privacy laws that apply to your customers.