Facebook Conversions API: send leads and approved orders to Meta

4 min read Read in: Русский
On this page
  1. How it works
  2. Step 1. Get the pixel ID and an access token
  3. Step 2. Prepare the flow link
  4. Step 3. Create the postback
  5. Step 4. Test the postback
  6. Check real events
  7. Common problems
  8. Related articles

The Facebook Conversions API (CAPI) lets AFF1 send events to Meta from the server: when a lead is created, confirmed or cancelled. The pixel on the page only sees that the order form was submitted; the Conversions API also tells Meta which orders the call centre confirmed, so your campaigns can optimise for real sales.

How it works

  1. A visitor clicks your ad. Meta adds its click ID, fbclid, to the link.
  2. Your flow link also carries fbpx — the ID of the pixel that should receive the event.
  3. When the lead is created, confirmed or cancelled, AFF1 sends the event you chose to that pixel together with the click data, and Meta matches it to the ad click.

Without fbclid and fbpx in the link, Meta cannot match the event to your ad. The fbpx parameter must be added to the flow link manually.

Step 1. Get the pixel ID and an access token

  1. Open Meta Events Manager and select your dataset (pixel). Copy its ID.
  2. Open Settings, find the Conversions API section and click Generate access token. Copy the token.

Keep the token secret: anyone who has it can send events to your pixel. Generate a new one if it leaks.

Add the fbpx parameter with your pixel ID to the flow link you use in the ad:

http://your-domain.com/?flow_hash=AbCd1234&fbpx=123456789012345

Meta adds fbclid to the link by itself when someone clicks the ad. If your traffic goes through a tracker or another redirect, make sure that fbclid reaches the AFF1 link: pass it on in the tracker, and do not add a literal fbclid={fbclid} to the ad URL — Meta does not replace such macros, and a second fbclid breaks matching.

The hint in the English interface of the postback window says fbx; the parameter name is fbpx — the same name is used in the API and in landing archives.

Step 3. Create the postback

  1. Open Tools → Flows → your flow → Postback → Create postback.
  2. Type: Facebook Conversion API.
  3. Tick the lead events that should send this Meta event: Creating lead, Confirming lead and/or Cancelling lead.
  4. Enter Facebook Pixel id and Access Token. Click Add under the pair to add more pixels.
  5. Event — choose a standard Meta event from the list (Lead, Purchase, CompleteRegistration and others).
  6. For Purchase, fill in Custom data: Currency (ISO code, for example USD) and Value — the amount Meta should see for one conversion.
  7. Action Source — where the conversion happened. For site traffic choose website and enter Event Source Url — the address of the page where the action takes place, for example your landing domain.
  8. Click Add.
Facebook Conversion API postback: events, pixel ID and token, Purchase event with currency and value, action source website
A Purchase event for confirmed leads

Each postback sends one Meta event. To send Lead for new orders and Purchase for confirmed ones, create two postbacks:

PostbackLead event in AFF1Meta event
1Creating leadLead
2Confirming leadPurchase (with Currency and Value)

More options in the window:

  • Warm-up mode — when it is on, events go to all the pixels added in this postback, not only to the pixel from fbpx;
  • Use proxy — sends the events through a proxy server. Leave it off unless your manager recommends it.

Meta accepts server events up to 7 days after they happen. Leads confirmed later than that will not be counted by Meta.

Step 4. Test the postback

  1. In Meta Events Manager, open your dataset → Test events and copy the test event code (it looks like TEST12345).
  2. In AFF1, in the flow’s postback list, click the gear icon next to the Facebook postback → Testing.
  3. Paste the code into Event testing and click Check.
  4. The test event should appear in the Test events tab within a few minutes. If you see an error, check the pixel ID and the token.
Facebook event testing window with a field for the test event code
Flow postbacks: a Facebook Conversion API postback and an s2s postback

Check real events

In Events Manager, open the dataset Overview: it shows the events received from the server and their match quality.

Common problems

  • Events are sent but not matched to ads — the link had no fbclid (the visitor did not come from an ad, or a redirect dropped it) or fbpx pointed to another pixel.
  • The test fails with a token error — the token was revoked or belongs to another dataset. Generate a new one in Settings → Conversions API.
  • Purchase without revenue — Currency and Value are empty or wrong.
  • Every confirmed lead is counted twice — the same order is sent as Purchase both by the pixel on the order page and by the postback. Keep Purchase in one place.

Still have questions?

Your personal manager and AFF1 support answer in Telegram 24/7.