The Meta Conversions API (CAPI) lets you send conversion events to Meta from a server instead of only from the visitor's browser. Meta recommends running it alongside the Meta Pixel, with both channels sharing an event ID so each action is counted once. Done well, the Meta Conversions API gives the ad account a more complete and better-matched record of real conversions; done badly, it double counts leads and teaches the algorithm the wrong lesson.
Key takeaways
- Run the Pixel and the Conversions API together, and give every event a shared
event_id so Meta can deduplicate them.
- Pick the implementation by the client's stack and budget: a partner integration, the CAPI Gateway, server-side GTM, a direct API build, or a customer data platform.
- Event match quality depends on the customer information you send (hashed email and phone,
fbp, fbc, IP and user agent), not on the fact that events come from a server.
- For lead generation, the most useful server event is often a qualified lead from the CRM, not just another copy of the form fill.
- CAPI is not a one-off install. Site changes, plugin updates and consent changes break it quietly, so it needs testing and monitoring.
What is the Meta Conversions API?
The Conversions API is a Meta endpoint that accepts events, such as Lead, Purchase or CompleteRegistration, sent from a server you control. Each event carries a name, a timestamp, the source of the action, customer information used for matching, and optional custom data such as value and currency. Meta matches the event to a person on its platforms and uses it for reporting, attribution and campaign optimization.
The Meta Pixel does the same job from the browser. It runs JavaScript on the page, reads the _fbp and _fbc cookies, and sends events directly from the visitor's device. That gives it rich browser context. It also makes it fragile: ad blockers, browser privacy features, slow pages and visitors who leave before the tag fires all cost you events.
Server events are not exposed to those browser-side losses in the same way. A server can also send events that never happen in a browser at all, such as a lead that the sales team marks as qualified two days later, or an order that is confirmed only after payment clears.
Why run the Pixel and the Conversions API together?
Meta's guidance is to use both, a setup it describes as redundant. The browser channel has context the server lacks unless you pass it along; the server channel catches events the browser misses and can include data collected at the moment of conversion. Together they cover each other's gaps.
The cost of redundancy is that most conversions arrive twice. Meta needs a reliable way to know the browser Lead and the server Lead are the same action. That mechanism is deduplication, and it is where most agency setups go wrong. We cover it in detail below.
One thing CAPI is not: a way around consent. If a visitor has declined marketing tracking, sending their data from a server instead of the browser does not change what you are allowed to do with it. We come back to this in the privacy section.
Diagram
Suggested diagram: a visitor submits a form. Two arrows leave the moment of submission: one from the browser (Pixel, with eventID) and one from the server (Conversions API, with event_id). Both arrive at Meta Events Manager, where a "deduplicate" step merges them into one Lead. A third, later arrow comes from the CRM with a "QualifiedLead" event. Alt text: "Diagram showing a single form submission sent to Meta by both the Pixel and the Conversions API with a shared event ID, merged into one event, plus a later qualified-lead event sent from the CRM."
How do you implement the Meta Conversions API? The main options
There is no single right way to set up CAPI. The right choice depends on the client's platform, how much control you need over the data, who will maintain it, and what it costs to host. These are the five routes we see most often.
Partner integrations (Shopify, WordPress and others)
Meta has built or approved integrations with many platforms. Shopify's Facebook and Instagram sales channel, WooCommerce and WordPress plugins, and several CRMs and form tools can send server events with little or no code. For a standard ecommerce store this is often the fastest route to a working setup.
The trade-off is control. You get the events the integration chooses to send, with the parameters it chooses to include. The most common problem we find is not the integration itself but a second, older Pixel installation running alongside it, so the browser event fires twice and only one copy has an event ID that matches the server.
Conversions API Gateway
The CAPI Gateway is a Meta product that you host in your own cloud account. Meta's documentation lists hosting options on AWS and Google Cloud. Once connected to a Pixel, it mirrors the Pixel's browser events to the server side automatically, with deduplication handled for you.
It is low-code and quick to stand up, and one Gateway instance can serve several Pixels, which suits agencies. Its limit is that it mirrors what the Pixel already sends. If the Pixel is sending the wrong events, the Gateway faithfully sends the same wrong events from a server. It does not help with CRM or offline events.
Server-side Google Tag Manager
With a server-side GTM container, the website sends data to a tagging server on a first-party subdomain, and a Meta Conversions API tag in that container forwards events to Meta. This is the most flexible web option: you control exactly which events go out, which parameters are included, and you can enrich or strip data before it leaves your server.
It also takes the most care. You need hosting, a custom domain, a client in the container to receive data, and a clear plan for passing the event ID from the browser to the server. Our server-side Google Tag Manager setup guide walks through the container itself.
Direct API integration
A developer can call the Conversions API directly from the client's backend or CRM. This is the best route for events that only exist on a server: a lead qualified in the CRM, an order confirmed after fraud checks, a subscription renewal. It is also the route with the most engineering and the most maintenance, since you own the access token, the API version, error handling and retries.
Customer data platforms such as Segment
If the client already runs a CDP such as Segment, it can usually forward events to the Conversions API as a destination. This keeps event definitions in one place. The catch is that the mapping between the CDP's events and Meta's standard events, and the handling of event IDs, are only as good as the configuration, and they are easy to get subtly wrong.
Comparing the options
| Option | Effort to set up | Control over data | Handles CRM or offline events | Best fit |
| Partner integration | Low | Low | Sometimes, depending on the platform | Standard Shopify or WordPress stores |
| CAPI Gateway | Low to medium | Low (mirrors the Pixel) | No | Agencies wanting quick server coverage for web events |
| Server-side GTM | Medium to high | High | Not on its own; can receive server calls | Sites already on GTM that need custom events and data control |
| Direct API | High | Full | Yes | Lead gen with a CRM, custom backends |
| CDP (e.g. Segment) | Medium if the CDP exists | High | Yes, if the CDP receives them | Clients with an existing CDP |
Many clients end up with a combination: server-side GTM for website events, plus a direct or CRM-based integration for qualified leads. That is fine, as long as each event has exactly one browser source and one server source, and both share an ID.
How does Pixel and Conversions API deduplication work?
When Meta receives a browser event and a server event for the same Pixel, it checks two fields. The Pixel's event name must match the server's event_name exactly, and the Pixel's eventID must match the server's event_id exactly. If both match and the events arrive within Meta's deduplication window, which Meta documents as 48 hours, Meta keeps one and discards the other.
The practical rule is simple: generate one ID at the moment the person acts, and pass that same ID to both channels. Do not let the browser and server each generate their own. Do not use a value that changes between the two, such as a timestamp captured separately on each side.
// Browser: on a confirmed successful submission, not on button click
const eventId = 'lead_' + Date.now() + '_' + Math.random().toString(36).slice(2, 10);
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'lead_submitted',
event_id: eventId,
form_name: 'quote_request'
});
// The Pixel tag in GTM reads event_id from the dataLayer:
// fbq('track', 'Lead', {}, { eventID: eventId });
// The server tag or backend sends the same value as event_id.
Meta also documents a fallback that uses fbp or external_id when no event ID is present. Treat it as a safety net. We send an explicit event ID with every event that goes out through both channels.
For the details, including how to read deduplication in Events Manager, see our Pixel and Conversions API deduplication guide. If the client is on Shopify or WordPress and you suspect a plugin is sending extra copies, start with our guide to duplicate Meta events on Shopify and WordPress.
What customer information should you send, and how do you hash it?
Every server event carries a user_data object. This is what Meta uses to match the event to a person. Without it, a server event is close to useless for attribution, however reliably it arrives.
Meta's customer information parameters fall into two groups:
- Must be hashed with SHA-256 before sending: email (
em), phone (ph), first and last name (fn, ln), date of birth, gender, city, state, zip and country. Hashing external_id is recommended.
- Must not be hashed:
client_ip_address, client_user_agent, fbc, fbp, and identifiers such as lead_id.
Normalize before you hash, or the hash will not match anything. For email, trim spaces and lowercase. For phone, strip symbols, letters and leading zeros, and include the country code, so a US number written as (650) 555-1212 becomes 16505551212 before hashing. A hash of an un-normalized value is a perfectly valid string that matches nobody, and nothing in the API response will tell you that.
{
"data": [
{
"event_name": "Lead",
"event_time": 1795251600,
"event_id": "lead_1795251600_k3x9q2ab",
"action_source": "website",
"event_source_url": "https://www.example.com/quote/",
"user_data": {
"em": ["<sha256 of lowercased, trimmed email>"],
"ph": ["<sha256 of digits-only phone with country code>"],
"external_id": ["<sha256 of the CRM contact ID>"],
"client_ip_address": "203.0.113.24",
"client_user_agent": "Mozilla/5.0 (...)",
"fbp": "fb.1.1795251000000.1234567890",
"fbc": "fb.1.1795250000000.AbCdEf123"
},
"custom_data": {
"lead_type": "quote_request"
}
}
]
}
For website events, Meta requires the event source URL and the client user agent, and recommends sending the IP address as well because it can improve matching. The fbp and fbc values come from the browser cookies, so whatever sends the server event needs a way to read them, usually by passing them from the page to the server along with the event ID.
What is event match quality and how do you improve it?
Event match quality (EMQ) is Meta's score, shown per event in Events Manager, for how well the customer information you send can be matched to Meta accounts. It is a score out of 10, and Events Manager shows which parameters are being received and which are missing.
The score moves when you send more and better identifiers. In practice the biggest gains come from a few things:
- Send hashed email and phone on lead and purchase events. These are usually available at the moment of conversion, from the form or the checkout.
- Pass
fbp and fbc to the server. They are often missing from server events because nobody wired the cookies through.
- Include IP address and user agent for website events, taken from the visitor's request, not from your server.
- Normalize correctly before hashing. Bad normalization is invisible and common.
- Use a stable
external_id, such as a hashed CRM contact ID, consistently on browser and server events.
A low score on PageView is normal, because nobody has given you an email at that point. A low score on Lead or Purchase deserves investigation. Our event match quality guide goes parameter by parameter.
Lead generation: should CAPI send form fills or qualified leads?
For ecommerce, the purchase is the outcome and the value is known at checkout. Lead generation is different. A form fill is a hand-raise, not a sale, and many form fills are spam, duplicates, students, job seekers or people outside the service area.
If the only event Meta sees is the raw form submission, the campaign optimizes for people who fill in forms. That is not always the same as people who become customers. The Conversions API lets you send a second, later event when the lead actually qualifies in the CRM.
Example
An illustrative home services client gets quote requests through a website form. The setup sends three events:
Lead from the Pixel and CAPI at submission, deduplicated with a shared event ID.
QualifiedLead (a custom event) from the CRM when the sales team marks the lead as in the service area and genuine. It carries the same hashed email and phone, and the same external_id, so Meta can match it.
Purchase from the CRM when a job is booked, with an estimated value.
The media buyer can then compare campaigns on qualified leads rather than form fills, and decide which event to optimize for once there is enough volume. All event names and values here are illustrative.
Two cautions. First, server events have a time limit. Meta's documentation says event_time can be up to 7 days before you send the event, and a request containing an older event fails. A lead that qualifies three weeks after the click cannot be sent as a standard website event. Meta has separate options for CRM and offline data, and their rules differ, so check the current documentation for the source you are using.
Second, think before you switch optimization to a deeper event. A campaign needs enough conversions of an event to learn from it. Optimizing for a rare event can starve the campaign of signal. That is a media buying judgment, and tracking only makes the option available.
For Meta lead ads (instant forms), Meta offers a separate CRM-based setup, sometimes called conversion leads optimization, that uses the Meta lead ID to send lead stage updates back. If the client runs instant forms, ask whether that route fits better than a website-based setup.
What timing rules apply to server events?
Timing matters in three places:
- The 7-day limit on
event_time. Server events older than this are rejected, and Meta's documentation says the whole request fails if any event in it is too old. Batch carefully so one stale event does not sink the rest.
- The 48-hour deduplication window. A browser event and a server event with the same name and ID are merged only if they arrive within this window.
- Freshness for optimization. Even inside the limits, events that arrive quickly are more useful for delivery than events sent in a nightly batch. Send web events in real time, or close to it, where you can.
Set event_time to when the action happened, in Unix seconds, not when your server got round to sending it. A queue that stamps events at send time quietly distorts reporting.
How do you test Conversions API events?
Testing has three layers, and we do all of them on every setup.
- Test Events in Events Manager. Open the Pixel in Events Manager, go to Test Events, and copy the test code. Add it to server events as
test_event_code while testing. Browser events from a test session show up there too. Remove the test code before going live.
- Check deduplication. Submit a real test form. In Test Events you should see the browser and server
Lead with the same event ID, and Meta should indicate one was deduplicated.
- Check the payload. In server-side GTM Preview, or your backend logs, confirm the request includes hashed email and phone,
fbp, fbc, IP and user agent, and that the API response reports events received with no errors.
After launch, the Diagnostics tab in Events Manager flags problems such as missing parameters, deduplication issues and events Meta could not process. Check it after any site change, not just at setup.
Does CAPI matter more with Advantage+ campaigns?
Meta's Advantage+ campaign types automate more of targeting, placements and creative delivery. The more a campaign decides for itself, the more it depends on the conversion events you feed it to judge what is working.
That makes signal quality matter: the right event, counted once, matched well, sent promptly. It does not mean CAPI will lift results. We cannot promise better ROAS or more leads from tracking. What correct tracking does is make sure the algorithm, and the people reading the reports, are working from an accurate record of what happened.
If the event being optimized is a raw form fill full of spam, Advantage+ will find more people who fill forms. That is the main reason we push lead gen clients toward sending a qualified-lead event, even if they keep optimizing for the form fill until volume allows otherwise.
What privacy considerations apply to server-side Meta events?
Sending events from a server does not change the legal basis for collecting or sharing them. Several points come up on almost every project:
- Consent. If the site uses a consent banner, the server path must respect the same choice as the browser path. A common mistake is a server-side setup that sends events for visitors who declined marketing cookies, because the consent signal never reached the server. Our Consent Mode v2 implementation guide covers how consent state flows through GTM.
- Data minimization. Send what is needed for matching and measurement. Do not forward free-text form fields, notes, or anything sensitive in
custom_data.
- Regulated categories. Meta restricts certain data and event setups for some industries, such as health and financial services. Do not send information that reveals a health condition or similar sensitive detail.
- US state privacy laws. Meta offers a Limited Data Use option, set through data processing parameters on events. Whether to use it is a client decision.
None of this is legal advice. Involve the client's compliance or legal team before sending customer data to Meta, especially in regulated industries, and document what is sent and why.
What are the most common Meta Conversions API mistakes?
These are the problems we find most often when we audit client accounts:
- No event ID, or mismatched IDs. The browser and server each generate their own, so every conversion counts twice.
- Two browser sources. A hardcoded Pixel plus a plugin plus GTM, each firing
Lead.
- Event fires on click, not success. The
Lead event is attached to the submit button, so failed validation and double clicks count.
- Event name mismatch.
Lead from the browser and lead or generate_lead from the server.
- Unhashed or badly normalized identifiers. Raw email sent in plain text, or hashes of uppercase emails and formatted phone numbers.
- Missing
fbp and fbc on server events. The server never received the cookies.
- Test code left in production. Meta says
test_event_code is for testing only and must be removed from the production payload.
- Expired or revoked access tokens. Server events stop and nobody notices for weeks.
- Consent ignored on the server path. A privacy problem, not just a tracking one.
A quick sanity check for lead gen: compare a week of Meta-reported leads with leads the client's CRM received from all sources. If Meta reports more leads than the CRM has in total, something is double counting.
How do you maintain a Conversions API setup?
CAPI breaks quietly. The site still works, the ads still run, and the numbers just drift. We treat maintenance as part of the setup, not an afterthought:
- Weekly: check event volumes for the key events against expectations and against the CRM. A sudden drop or jump is the first sign of breakage.
- After any site change: new form, new theme, plugin update, new checkout, consent banner change. Rerun a test submission and check Test Events.
- Monthly: review Diagnostics and event match quality for the main events, and confirm deduplication is still working.
- Ownership: know who owns the access token, the hosting account for server-side GTM or the Gateway, and the Business Manager permissions. Agencies lose access when people leave.
- Documentation: keep a short tracking spec per client: events, triggers, IDs, parameters, where each is sent from.
If you would rather hand this to someone, our Meta Conversions API setup service covers implementation, deduplication and testing, and documents everything under your agency's name.
A Meta Conversions API launch checklist
- Inventory every place a Pixel or Meta event currently fires on the site, and remove duplicates.
- Decide the events: which standard events, which custom events, and which come from the CRM.
- Choose the implementation route for web events and for CRM events.
- Fire conversion events on confirmed success, not on click.
- Generate one event ID per action and pass it to both Pixel and server.
- Send normalized, hashed email and phone; pass
fbp, fbc, IP and user agent.
- Respect consent on both paths.
- Test with Test Events: both channels arrive, IDs match, deduplication works.
- Remove the test code and go live.
- Check Diagnostics and EMQ after a few days, and compare event counts with the CRM.
- Document the setup and set up ongoing monitoring.
Guides in this cluster
We are adding more guides on Meta server-side tracking to this cluster. For the Google side of the same problem, see our complete guide to Google Ads conversion tracking.
Want us to check one of your client accounts? Get a free tracking check →