How to Set Up Meta Conversions API (Facebook CAPI)
Meta's Conversions API (formerly known as the Server-Side API) is the most important tracking upgrade you can make for your Facebook and Instagram ad campaigns. With browser-based pixel tracking losing effectiveness due to iOS privacy changes, ad blockers, and cookie restrictions, CAPI provides a server-to-server connection that sends conversion data directly to Meta without relying on the browser.
The Conversions API works alongside the Meta Pixel, not as a replacement. The pixel handles browser-side events like page views and add-to-cart actions, while CAPI sends the same or additional events from your server. Meta deduplicates these events using event IDs, ensuring each conversion is counted only once while maximizing the chances that the event is received through at least one channel.
To set up CAPI, you need three things: a Meta Business Manager account, a dataset (previously called a pixel) with a system user access token, and a server that can make HTTPS requests to Meta's Graph API. The endpoint follows this format: POST https://graph.facebook.com/v19.0/{DATASET_ID}/events.
Each event you send must include the event name (Purchase, AddToCart, Lead, etc.), the event time as a Unix timestamp, the action source (set to "website" for eCommerce), and user data for matching. The user data fields are critical: hashed email, hashed phone number, client IP address, user agent, and the fbc and fbp cookie values. The more user data you provide, the higher your Event Match Quality (EMQ) score, and the better Meta can attribute the conversion to the right ad click.
Event deduplication is where most implementations go wrong. Both your pixel and CAPI will fire for purchase events. If you do not include the same event_id in both the pixel event and the CAPI event, Meta will count the purchase twice. Generate a unique event ID when the conversion happens, include it in the pixel fire on the thank-you page, and send the same ID in your CAPI request. Meta will see both events, match them by ID, and count it as one conversion.
For Shopify stores, the typical implementation uses Shopify order webhooks to trigger CAPI events. When an order is confirmed, your server receives the webhook payload containing customer email, phone, order value, and product details. You hash the personal data, enrich it with the fbp/fbc cookies stored during the browsing session, and send it to Meta. The entire process should complete within seconds of the order being placed.
To verify your implementation, use the Test Events tool in Meta Events Manager. It provides a test event code that you append to your CAPI requests during testing. Events sent with the test code appear in real-time in the Events Manager interface, showing you exactly what data Meta received and the match quality for each event.
Common issues include low EMQ scores (usually caused by missing user data parameters), time zone mismatches in event timestamps, and sending events too long after the conversion occurred. Meta recommends sending events within one hour of the action, though sooner is always better. Events sent more than 24 hours after the action may not be used for attribution at all.
Once CAPI is properly configured, you should see your Event Match Quality score rise above 6.0 (on a scale of 1 to 10) in Events Manager. You will also notice more attributed conversions in your campaign reports as Meta can now track conversions that the pixel alone would have missed. This directly improves your campaign optimization because Meta's algorithm has more accurate data to learn from. Many brands see a 15 to 30 percent improvement in attributed conversions after implementing CAPI, which translates to lower CPAs and better ROAS over time.