Meta Conversions API
Credentials
- business.facebook.com → Events Manager → select your data set (pixel).
- Settings → section Conversions API → Set up manually → Generate access token.
- Note the pixel id (data set id) shown in the same place.
PUT /v1/projects/{project}/destinations/meta
{
"enabled": true,
"mode": "test",
"transport": "direct",
"settings": { "pixelId": "1234567890123456", "apiVersion": "v26.0", "testEventCode": "TEST12345" },
"secrets": { "accessToken": "EAAB…" }
}With "transport": "composio" and an adConnectionId, events go through Composio's
METAADS_SEND_CONVERSION_EVENTS using the Meta ad connection – no separate token is stored. The
connection's token must have access to the pixel.
What is sent
POST https://graph.facebook.com/{apiVersion}/{pixelId}/events with one event per conversion:
| Field | Value |
|---|---|
event_name | the definition's Meta eventName |
event_time | conversion time (Unix seconds) |
event_id | the conversion's event id (deduplication with the browser pixel) |
action_source | chat for whatsapp_manual; website for quiz/booking/event/goal/lead conversions with a user agent; otherwise system_generated |
event_source_url | the page of the conversion (only with action_source: website) |
user_data.em, ph, fn, ln, ct, st, zp, country | SHA-256 hashes, normalized per Meta's rules – from the conversion and the journey's leads |
user_data.external_id | SHA-256 of the journey id (and your external id when given) |
user_data.client_ip_address, client_user_agent | request context, when your server passed it |
user_data.fbc | the _fbc cookie, or built from the fbclid closest before the conversion in any session of the journey (fb.1.<first click ms>.<fbclid>) |
user_data.fbp | the _fbp cookie (only after consent, or passed by your server; remembered for the journey for 90 days) |
custom_data.value, currency | from the conversion or definition, when the value is above 0 |
An event needs at least one match key (em, ph, external_id, fbc, fbp or IP); otherwise the
status is skipped ("no customer identifiers"). Meta accepts events up to 7 days old; older
conversions are skipped (3x keeps one hour of margin).
Matching data (Abgleich-Daten)
settings.matching decides what X3 sends to recognise the person (dashboard: Einstellungen › Meldungen ›
Abgleich-Daten für Meta; MCP conversions_destinations_list shows it):
matching | Sent in user_data | Use when |
|---|---|---|
full (default – every existing destination keeps it) | everything in the table above | your privacy policy covers hashed contact data, IP and user agent |
click_id_only | only fbc (from the _fbc cookie or the fbclid of the visit/journey) | your privacy policy promises that Meta gets the ad click id only |
With click_id_only an event carries exactly event_name, event_time, event_id,
action_source: system_generated (Meta requires a user agent for website, which this mode never sends),
user_data.fbc and custom_data (value, currency, order id). No em, ph, fn, ln, address,
country, external_id, client_ip_address, client_user_agent or fbp. A conversion without an ad
click id is skipped ("no ad click id …") – there is no fallback to other identifiers.
PUT /v1/projects/{project}/destinations/meta
{ "settings": { "matching": "click_id_only", "requireMarketingConsent": true } }Marketing consent
settings.requireMarketingConsent: true (default false) reports a conversion only when the person
agreed to marketing on your site: its lead – or a lead of the same visit – carries the trait
consent_marketing: true. Without it the conversion is skipped with "no marketing consent (this Meta
destination reports only with consent)". Ways to record the consent:
- browser:
x3.lead({ …, consent: { marketing: true } }) - your server:
leads.createwithtraits: { "consent_marketing": true }– send it only when your cookie banner's marketing choice was accepted (never setfalse→truelater without a new decision)
Consent counts only for the visit it was given on (other sessions of the journey do not count). Use it for sites with a cookie banner whose marketing choice also covers server-side reporting.
Deduplication with the browser pixel
If you also fire the pixel in the browser, pass the same event name and the same id
(eventID in fbq('track', 'Lead', {}, { eventID })) as the conversion's eventId. Meta then
counts one conversion. In the browser, x3.conversion(definition, { eventId }) takes your id (or
resolves with the generated one); from your server pass eventId to conversions.create.
Leads: store the pixel's eventID on the lead as trait meta_event_id (and the browser event name as
meta_event_name, default Lead). A lead-triggered conversion whose definition reports the same Meta
event name then uses that id as event_id; a different name (e.g. browser StartSignup, server
CompleteRegistration) keeps X3's own id – Meta only deduplicates identical event names.
Testing
- Events Manager → Test events → copy the test code into
settings.testEventCode. - Set the destination
modetotest(orlivewith the test code – events then still land in Test events). POST /v1/projects/{project}/destinations/meta/testor trigger a real conversion.- Check that the event appears as Server and – when the pixel fired – as deduplicated.
- Remove the test code and set
mode: "live".
Repair with Claude
A sale or lead came in through Meta ads, but Meta never heard of it (the conversion shows
meta: not_configured – „Meta destination not configured“) and X3 opens the problem
„… über Meta nicht an Meta gemeldet“. You can fix it from Claude with the X3 connector, with the normal
read + write connection of your project – no admin rights, no password step, no token to copy:
- Find the cause:
conversions_list(providermeta) shows the upload state and its error,conversions_destinations_listwhether a Meta destination is on,tasks_listthe open problemreporting_missing. - Pick the pixel:
conversions_targets_list(providermeta) lists the pixels (datasets) of your connected ad account; the one your campaigns optimise for comes first. - Set it up:
conversions_destination_updatewithtransport: "composio",mode: "test"andsettings: { "pixelId": "…", "testEventCode": "TEST…" }(Events Manager › Test events). It reports through your existing Meta connection; a pixel outside your ad account is refused. - Test:
conversions_send_test(providermeta) and check Events Manager › Test events. - Go live:
conversions_destination_updatewithmode: "live"andsettings: { "testEventCode": null }. - Catch up:
conversions_retry_unreported(providermeta) re-sends what was not reported, with its original event id (Meta deduplicates against the pixel). Meta only accepts events up to 7 days old; older ones come back astooOldand are not sent.
Ask Claude for example: „Mein Kauf von heute wurde nicht an Meta gemeldet. Richte die Meldung über
meine Meta-Verbindung ein, teste sie und hol die Käufe der letzten 7 Tage nach.“ Your own push rules for
sales („Neue Käufe“) are in notifications_rules_list / notifications_rules_update.
Typical errors
| Error | Meaning |
|---|---|
190 Invalid OAuth access token | token revoked or expired – generate a new one |
100 Invalid parameter with event_time | conversion older than 7 days |
2804050 … test_event_code | the test code no longer exists – remove it |