Meta Conversions API

Credentials

  1. business.facebook.com → Events Manager → select your data set (pixel).
  2. Settings → section Conversions API → Set up manually → Generate access token.
  3. 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:

FieldValue
event_namethe definition's Meta eventName
event_timeconversion time (Unix seconds)
event_idthe conversion's event id (deduplication with the browser pixel)
action_sourcechat for whatsapp_manual; website for quiz/booking/event/goal/lead conversions with a user agent; otherwise system_generated
event_source_urlthe page of the conversion (only with action_source: website)
user_data.em, ph, fn, ln, ct, st, zp, countrySHA-256 hashes, normalized per Meta's rules – from the conversion and the journey's leads
user_data.external_idSHA-256 of the journey id (and your external id when given)
user_data.client_ip_address, client_user_agentrequest context, when your server passed it
user_data.fbcthe _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.fbpthe _fbp cookie (only after consent, or passed by your server; remembered for the journey for 90 days)
custom_data.value, currencyfrom 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):

matchingSent in user_dataUse when
full (default – every existing destination keeps it)everything in the table aboveyour privacy policy covers hashed contact data, IP and user agent
click_id_onlyonly 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 } }

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.create with traits: { "consent_marketing": true } – send it only when your cookie banner's marketing choice was accepted (never set false → true later 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

  1. Events Manager → Test events → copy the test code into settings.testEventCode.
  2. Set the destination mode to test (or live with the test code – events then still land in Test events).
  3. POST /v1/projects/{project}/destinations/meta/test or trigger a real conversion.
  4. Check that the event appears as Server and – when the pixel fired – as deduplicated.
  5. 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:

  1. Find the cause: conversions_list (provider meta) shows the upload state and its error, conversions_destinations_list whether a Meta destination is on, tasks_list the open problem reporting_missing.
  2. Pick the pixel: conversions_targets_list (provider meta) lists the pixels (datasets) of your connected ad account; the one your campaigns optimise for comes first.
  3. Set it up: conversions_destination_update with transport: "composio", mode: "test" and settings: { "pixelId": "…", "testEventCode": "TEST…" } (Events Manager › Test events). It reports through your existing Meta connection; a pixel outside your ad account is refused.
  4. Test: conversions_send_test (provider meta) and check Events Manager › Test events.
  5. Go live: conversions_destination_update with mode: "live" and settings: { "testEventCode": null }.
  6. Catch up: conversions_retry_unreported (provider meta) 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 as tooOld and 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

ErrorMeaning
190 Invalid OAuth access tokentoken revoked or expired – generate a new one
100 Invalid parameter with event_timeconversion older than 7 days
2804050 … test_event_codethe test code no longer exists – remove it