Skip to content
Ads & Attribution

Meta Conversions API for Cash on Delivery: How MyLeadDone Reports Delivered Orders Back to Meta

MyLeadDone Team
14 min read
Meta Conversions API for cash on delivery: MyLeadDone sends a Purchase event to Meta when the COD order is delivered
Contents

MyLeadDone now sends a Purchase event to your Meta dataset through the Meta Conversions API when a cash-on-delivery order is delivered — not when the customer fills in the order form. Your ad account hears about the orders that actually reached a customer and were paid for at the door, instead of stopping at the lead.

This article explains the problem the feature solves, how it fits into the MyLeadDone order workflow — import, phone confirmation, delivery follow-up, courier status — and exactly what is sent to Meta, and when. It describes the integration as it ships today, and links to Meta's own documentation wherever Meta-specific behavior is involved.

In Short: What the MyLeadDone Meta Integration Does

  • Trigger: the order's status becomes Delivered — in COD, the moment the customer pays the courier. Nothing is sent when an order is created, cancelled, refused or returned.
  • Event: one server-side Purchase per delivered order, with the order amount in MAD, sent through the Meta Conversions API to your own Meta dataset — the one behind your Meta Pixel.
  • Matching: hashed customer information (phone number, name, city, country), plus the Facebook click ID, the Meta browser ID, IP address and user agent whenever the order carried them.
  • Pixel: your Pixel keeps measuring what happens in the browser. MyLeadDone adds the delivered sale the browser can never see. It does not replace the Pixel.
  • Safeguards: at most one Purchase per order, automatic retries on temporary errors, and a Meta ✓ marker on every order Meta has confirmed receiving.

The Hidden Problem With COD Advertising

Every COD advertiser knows the journey. Someone sees an ad on Facebook or Instagram, clicks, lands on a product page and fills in a short form: name, phone number, city. For the ad platform, that form is usually the finish line. The Pixel fires, a conversion is counted, and the campaign learns that this kind of person "converts".

In cash on delivery, the form is where the real work starts. The order still has to be confirmed, handed to a courier, delivered — and paid for, in cash, at the door. Days pass between the click and that final moment, and many orders never get there: the number is wrong, the customer changes their mind, the parcel is refused.

The ad platform sees none of it. Its feedback loop breaks at exactly the point where COD becomes risky.

Figure 1 — The traditional COD funnel

  1. Meta adFacebook or Instagram
  2. ClickThe visitor lands on the product page
  3. Order form submittedThe Pixel reports a conversionMeta's view usually stops here
  4. COD order createdNot yet confirmed
  5. ConfirmationReal intent and a correct address — or not
  6. Delivery and cash paymentThe only step that produces revenue
The dashed steps happen away from the website, so a browser Pixel cannot report them. The campaign is judged on forms, not on sales.

The result is a quiet but expensive distortion. A campaign that produces many cheap forms looks like a winner, even if few of those forms turn into delivered parcels. A campaign that brings fewer but more serious buyers looks weaker than it is. And when the ad account's automated delivery is steered toward "people who submit forms", it is steered toward the wrong outcome for a COD business.

Why a Lead Is Not a Sale in Cash on Delivery

In a prepaid store, the conversion and the payment happen together: the card is charged at checkout. COD separates them, and every stage in between loses orders:

  • A lead is not necessarily an order. Duplicate submissions, fake or mistyped numbers and curiosity clicks all look like conversions to a browser.
  • An order is not necessarily confirmed. Some customers cannot be reached; others cancel when they are called.
  • A confirmed order is not necessarily delivered. Customers are absent, change their mind or refuse the parcel.
  • A delivered order is the closest thing COD has to a completed sale. The customer has the product, and the courier has the cash.
StageWhat it provesMoney collected?
Lead (form submitted)Someone was interested enough to type a phone numberNo
COD orderThe submission is a usable orderNo
Confirmed orderA real person confirmed the product and the addressNo
Delivered orderThe customer received the product and paidYes

Put simply, "someone submitted a form" and "someone submitted a form, received the product and paid for it" are two very different facts. Only the second is a sale. An advertising system can only learn from the facts it is given — so which one you report to Meta matters.

What Is the Meta Conversions API?

The Meta Conversions API (CAPI) is a server-to-server connection that lets a business send conversion events from its own systems directly to Meta, instead of relying only on code running in a visitor's browser. Meta describes it as a connection between an advertiser's marketing data — "such as website events, app events, business messaging events and offline conversions" — and "Meta systems that optimize ad targeting, decrease cost per result and measure outcomes" (Meta for Developers).

Three ideas are worth knowing:

  • Events. Each conversion is sent as a named event. Meta's standard Purchase event means a purchase was made and requires a value and a currency; a Lead means a sign-up was completed (Meta standard events).
  • Customer information for matching. To connect an event to a person on Facebook or Instagram, it carries customer information. Personal fields such as phone number, name, city and country are normalized and hashed with SHA-256 before sending, while browser identifiers such as the click ID and browser ID cookies are sent as they are (customer information parameters).
  • Offline events. Not every sale happens on a website. Meta calls the Conversions API its "recommended integration method for sending offline and physical store events to Meta for use in ad measurement, attribution, and targeting" (offline events).

That last point is the one that matters for COD. A delivered COD order is a sale completed in person, at the customer's door, days after the click. It is exactly the kind of conversion a browser cannot report — and a server that knows the delivery outcome can.

Meta Pixel and Conversions API: How They Work Together

The Meta Pixel and the Conversions API are complementary, not competing. The Pixel is code on your store's pages that reports what visitors do in their browser, such as viewing a product or starting checkout. The Conversions API reports events from a server — here, MyLeadDone's — including events that happen long after the visitor has left the site.

Meta recommends using both: "For optimal ad performance, we recommend that advertisers implement the Conversions API alongside their Meta Pixel" (Meta for Developers).

Figure 2 — Pixel and Conversions API, side by side

In the browser

  1. Your store pageShopify, YouCan or your own site
  2. Meta PixelPage and product views, checkout started, form submitted (Lead)

On the server

  1. MyLeadDoneThe order is confirmed, shipped and delivered
  2. Meta Conversions APIPurchase, sent when the order is delivered

  1. Your Meta datasetThe same dataset as your Pixel
  2. Measurement, attribution and ad deliveryBrowser signals plus the delivered sale
The Pixel describes the visit. MyLeadDone's server event describes the outcome. Both arrive in the same dataset.
Meta PixelConversions API via MyLeadDone
Where it runsThe visitor's browserMyLeadDone's servers
What it can seeVisits, product views, checkout, form submissionConfirmation and delivery outcomes
Right event for CODViewContent, InitiateCheckout, LeadPurchase
When it firesDuring the visitWhen the order is delivered, days later
Browser limitationsExposed to ad blockers and connection issuesNot dependent on the browser

Does the Conversions API Replace the Meta Pixel?

No. MyLeadDone does not install a Pixel and does not remove yours. Keep your Pixel for browsing and checkout events; MyLeadDone adds a server-side Purchase for the one event the browser cannot see — the delivered order.

One Adjustment: Where Your Pixel Fires "Purchase"

Many COD stores fire the Pixel's Purchase event as soon as the order form is submitted, because that is the last moment the browser is involved. Once MyLeadDone reports a Purchase at delivery, that setup counts every delivered order twice — once as a form, once as a sale — and still counts every form that never became a sale. The two events cannot be merged by Meta's deduplication, because they are separate events recorded days apart.

The fix is simple: change the Pixel event fired on form submission to Lead or InitiateCheckout, and let the delivered Purchase come from MyLeadDone. Each event name then tells the truth about what happened.

How MyLeadDone Closes the COD Conversion Loop

Most Conversions API integrations answer one question: how do we send an event to Meta? For COD, that is the easy part. The hard part is knowing which orders deserve to be reported as sales — and that knowledge only exists where orders are confirmed, followed up and delivered.

That is where MyLeadDone already works. It imports the order, has operators confirm it by phone, keeps the customer informed on WhatsApp, follows the parcel with the courier and records the delivery. The Meta integration connects the last step of that operational pipeline back to the first step of the advertising funnel.

Figure 3 — The closed-loop COD funnel with MyLeadDone

  1. Meta adA click from Facebook or Instagram
  2. Order form submittedPixel event: Lead
  3. Order imported into MyLeadDoneFrom Shopify, YouCan, Google Sheets or the API — with click identifiers when available
  4. Confirmation call by an operatorProduct, quantity and address verified
  5. WhatsApp updates and delivery follow-upConfirmed and shipped messages, follow-up calls when a delivery stalls
  6. The courier delivers, the customer paysThe status arrives from the delivery company
  7. Order marked DeliveredThe COD sale is real
  8. Purchase sent to MetaThrough the Conversions API, to your own datasetLoop closed
Ad interaction → lead → confirmed COD order → delivered order → Purchase signal. Meta now hears about the outcome, not only the intention.

The value is not in the API call. It is in everything that happened before it: every Purchase MyLeadDone sends has passed through a confirmation call, courier tracking and a recorded delivery. MyLeadDone connects advertising → acquisition → confirmation → follow-up → delivery → conversion feedback in a single workflow.

The Complete Workflow, Step by Step

1. Acquire: the Order Enters MyLeadDone

Orders arrive from the sales channels a store already uses:

  • Shopify, through an order-creation webhook.
  • YouCan, through a script added to the store.
  • Google Sheets, where a sheet script sends each new row.
  • A custom store, through the MyLeadDone orders API.

At import, MyLeadDone also keeps the advertising identifiers that later let Meta connect the sale to the ad click: the Facebook click ID (fbclid), the _fbc and _fbp cookie values, and the shopper's IP address and user agent when they are available. On Shopify they are read from the landing page URL and from the order's note attributes, where many COD form apps store them. On Google Sheets you can map optional columns for them, and the orders API accepts them as fields. They are stored exactly as received, because a single altered character in a click ID breaks attribution.

2. Confirm: a Real Conversation Before Anything Ships

Every order is confirmed by phone. MyLeadDone operators call the customer, confirm the product, quantity and delivery address, and record the outcome — confirmed, no answer, unreachable, wrong number, postponed or cancelled. They can also confirm an upsell during the call. A repeat order from the same phone number within 48 hours is flagged, so operators can catch duplicates before anything ships twice, and an order that still cannot be confirmed after the three-day confirmation window is closed as unconfirmed. It never reaches a courier.

WhatsApp supports the call; it does not replace it. When a first-day call goes unanswered, the operator follows up with a prepared WhatsApp message. Once the order is confirmed, the customer receives an automated WhatsApp confirmation (when WhatsApp notifications are enabled for the store), and the parcel is created with the store's delivery company.

3. Follow Up: Keeping the Delivery on Track

Confirmed orders move into delivery tracking. When tracking starts, the customer receives an automated WhatsApp message saying the order has shipped and that the delivery team will be in touch. Operators then follow each order day by day. When a courier status signals a problem — the customer not answering the driver, for example — the order joins the operators' follow-up list: they call the customer, send a WhatsApp message if the call goes unanswered, and coordinate with the delivery side until the parcel is delivered or definitively returned.

For a deeper look at this stage, see our guides to confirming COD orders and reducing COD returns.

The Moment an Order Becomes a Real Conversion

MyLeadDone is connected to Moroccan delivery companies such as Sendit, Ameex, Ozon, OLivraison and Digylog. Couriers report parcel statuses either instantly through webhooks or through status checks MyLeadDone runs several times a day. Each courier status is mapped to a MyLeadDone status, and only a status that means the parcel was delivered — in COD, handed over against payment — moves the order to Delivered. A status MyLeadDone does not recognize is never treated as a delivery. Operators can also record a delivery manually.

That single status change is the pivot of the whole system. It is the moment the COD sale becomes real, and it drives two things at once:

Your billing and your advertising signal share one definition of success: a delivered order.

How MyLeadDone Sends the Purchase Event to Meta

When an order becomes Delivered and the store's Meta integration is active, MyLeadDone queues the event straight away and sends it from its servers to the store's own Meta dataset. Just before sending, it checks again that the order is still delivered. Sending the event as soon as the sale happens also follows Meta's best-practice guidance: "Sharing events when they happen can help your campaigns achieve the best results" (Conversions API best practices).

Figure 4 — The complete MyLeadDone data path

  1. Sales channels
    ShopifyYouCanGoogle SheetsStore API
  2. MyLeadDoneOrder, customer details, amount, products — and click identifiers when present
  3. Operators and WhatsAppPhone confirmation, customer updates, delivery follow-up
  4. Delivery companyParcel status by webhook or scheduled check
  5. Delivered orderThe COD payment has been collected
  6. Meta Conversions APIOne Purchase event per delivered order
  7. Your Meta dataset and adsMeasurement, attribution and ad optimization
No shared platform pixel is involved: each store sends to its own dataset with its own access token.

What the Purchase Event Contains

FieldWhat MyLeadDone sends
Event namePurchase
Event sourceOffline event (action source "physical_store") — Meta's documented route for conversions completed away from the website
Event timeThe moment the delivery was recorded
Value and currencyThe order amount, in MAD
Order detailsOrder reference, products and quantities
Customer information, hashed (SHA-256)Phone number in international format, first and last name, city (the courier's standard city name when available), country
Ad identifiers, unhashed as Meta specifiesClick ID (built from fbclid when needed), browser ID, IP address and user agent — when the order captured them
Event IDA stable ID unique to the order

Built-In Safeguards

  • Only delivered orders. Pending, cancelled, refused, returned or out-of-stock orders never produce a Purchase.
  • Once per order. Each delivered order is reported at most once, even if its status is saved twice or a send is retried.
  • Automatic retries. Temporary errors such as network issues or rate limits are retried several times with increasing delays. If Meta rejects the access token, sending pauses and the integration asks you to reconnect.
  • No event without a way to match it. An order with no amount, or with no usable identifier such as a valid phone number, is skipped and labeled with the reason.
  • Verified, not assumed. An order shows Meta ✓ only after Meta has confirmed receiving its event; a delivered order without that confirmation shows Meta —. A Meta history page lists every event as sent, pending, failed or skipped.
  • A private token. Your access token is encrypted, sent to Meta only in a secure request header, and never displayed again after you save it.

Setting It Up

  1. In Meta Events Manager, open the dataset (Pixel) your ads use and copy its dataset ID.
  2. In that dataset's Settings, under Conversions API, generate an access token.
  3. In MyLeadDone, open Integrations → Marketing & Publicité → Meta Ads, paste both values and save.
  4. Optionally, add a test event code from the Test events tab in Events Manager, so the test is visible in Meta without being counted.
  5. Click Tester & activer (test and activate). MyLeadDone sends an event based on a real delivered order from your store and switches sending on if it succeeds — so you need at least one order delivered in the last two months. Without a test code, that first event is a real Purchase for your latest delivered order.

Why Delivered-Order Signals Matter for Meta Ads

Meta's ad system learns from the conversions it receives and can connect to people. When the only conversion is a form, a campaign is rewarded for producing forms. Adding the delivered Purchase changes what the ad account can see in three ways:

  • Measurement. You can see how many delivered purchases, and how much delivered revenue, your ads are associated with — not only how many forms they produced.
  • Attribution. When a delivered order carries a click ID or matches a person Meta recognizes, the sale can be credited to the campaign and ad that drove it.
  • Optimization. Meta's Business Help Center presents the Conversions API as a way to optimize for actions that happen later in the customer journey. In COD, the delivered purchase is that later action.

What this does not do is guarantee a result. Meta does not promise a specific improvement from the Conversions API, and neither do we. How much a store benefits depends on its order volume, how many orders carry click identifiers or match a Meta account, and how its campaigns are configured. What changes for certain is the quality of the information: Meta hears about sales that happened, not only about intentions. It is the same principle behind measuring delivery rate by acquisition source instead of cost per order.

A Practical COD Example

The figures below are a hypothetical illustration, not MyLeadDone results. They show how the picture changes when Meta receives delivered purchases instead of forms.

A store spends 30,000 MAD on Meta ads in a month. The campaigns generate 1,000 order forms. Once duplicates, fake numbers and unusable submissions are removed, 700 are valid orders. Operators confirm 500. Couriers deliver 320.

Funnel stageOrdersAd cost per order
Order forms (leads)1,00030 MAD
Valid orders700≈ 43 MAD
Confirmed orders50060 MAD
Delivered and paid320≈ 94 MAD

If the Pixel reports every form as a Purchase, Meta believes the store made 1,000 sales at 30 MAD each. In reality it made 320 sales at about 94 MAD each — the signal overstates sales more than threefold. Now split the same month across two campaigns with equal budgets:

Campaign ACampaign B
Ad spend15,000 MAD15,000 MAD
Order forms600400
Cost per form25 MAD37.50 MAD
Delivered orders150170
Cost per delivered order100 MAD≈ 88 MAD

Judged on forms, Campaign A wins easily: its leads are a third cheaper. Judged on delivered sales, Campaign B wins: it produced more paying customers for the same budget. A lead-only signal pushes budget toward A. A delivered-purchase signal gives Meta — and you — the information needed to see that B is the better campaign.

What Ecommerce Vendors Should Check Before They Start

  • Connect your own dataset. Use the dataset (Pixel) your ad account actually works with. MyLeadDone never uses a shared pixel.
  • Rename the form-submission event. If your Pixel fires Purchase when the form is submitted, switch it to Lead or InitiateCheckout so sales are not counted twice.
  • Carry click identifiers into the order. Attribution is strongest when the order includes the fbclid, _fbc or _fbp values. Shopify orders from COD form apps that store the landing URL or these values in note attributes are captured automatically; on Google Sheets, map the optional columns; with the orders API, send the fields. On YouCan, only a click ID still present in the page URL can be recovered today. Without click identifiers, matching relies on the hashed phone number and customer details.
  • Make sure the dataset accepts offline events. Meta only accepts offline events through the Conversions API on an eligible (consolidated) dataset. The MyLeadDone integration shows a warning when it is not.
  • Test first. A test event code lets you see the event in Events Manager before real Purchases are counted.
  • Know what is not sent. Cancelled, refused and returned orders send nothing, and orders delivered before you activate the integration are not sent retroactively.

FAQ: Meta Conversions API for Cash on Delivery

What is the Meta Conversions API (CAPI)?
The Meta Conversions API is a server-to-server connection that lets a business send conversion events — website, app, messaging or offline events — from its own systems directly to Meta. Meta uses these events for ad measurement, attribution and optimization. It works alongside the Meta Pixel, which reports events from the visitor's browser.
What is Meta CAPI for COD ecommerce?
For cash-on-delivery stores, the Conversions API makes it possible to report the real sale — the delivered, paid order — rather than only the order form. Because delivery happens days after the click and away from the website, the event has to come from a server that knows the delivery outcome, such as MyLeadDone.
Why is the Conversions API important for cash on delivery?
In COD, many submitted orders are never confirmed or delivered, so browser conversions overstate sales. The Conversions API lets a store tell Meta which orders actually turned into revenue. That gives Meta better information for measurement and attribution, and a more meaningful conversion to optimize toward.
What happens when a COD order is delivered in MyLeadDone?
When a courier status or an operator marks the order Delivered, MyLeadDone records the delivery, charges the store for that delivered order and, if the Meta integration is active, immediately queues a Purchase event. It checks the order is still delivered, sends the event to the store's Meta dataset, and marks the order Meta ✓ once Meta confirms receipt.
How does MyLeadDone send Purchase events to Meta?
Server to server, through the Meta Conversions API, to the store's own dataset with the store's own access token. Each delivered order produces one Purchase with the order amount in MAD, the products, a stable event ID, hashed customer information and any click identifiers captured with the order. It is sent as an offline event, Meta's route for conversions completed away from the website.
What is the difference between a lead and a delivered order?
A lead means someone submitted an order form. A delivered order means that person was reached, confirmed the order, received the parcel and paid the courier. In COD, only the delivered order produces revenue, so it is the more accurate conversion to report to an advertising platform.
Why should ecommerce stores send Purchase events to Meta?
Meta can only measure and optimize for the conversions it receives. Sending real purchases, with their value, lets Meta associate ads with sales and revenue rather than with clicks or forms. Meta recommends sharing events when they happen and using the Conversions API alongside the Pixel.
How does MyLeadDone close the COD conversion loop?
MyLeadDone runs the operational steps that follow an ad click — order import, phone confirmation, WhatsApp updates, delivery follow-up and courier status tracking — and, when the order is delivered, sends the Purchase back to Meta. The advertising funnel and the real delivery outcome are joined in one loop.
Does MyLeadDone replace the Meta Pixel?
No. Keep your Pixel for browser events such as page views, product views and checkout starts. MyLeadDone adds the server-side Purchase for delivered orders. If your Pixel currently fires Purchase when the form is submitted, change that event to Lead or InitiateCheckout so sales are not counted twice.
How does the Conversions API work with Meta Ads?
Events sent through the Conversions API arrive in the same Meta dataset as your Pixel events. Meta matches them to people using customer information and click identifiers, then uses them for measurement, attribution and ad delivery in the campaigns connected to that dataset.
Are cancelled, refused or returned orders sent to Meta?
No. MyLeadDone sends a Purchase only for orders that reach Delivered. Orders that are cancelled, refused at the door or returned produce no event, so they are never counted as sales.
Is customer data protected when it is sent to Meta?
Personal details — phone number, name, city and country — are normalized and hashed with SHA-256 before they leave MyLeadDone, as Meta specifies. Click and browser identifiers are sent in the format Meta requires. The store's access token is encrypted and never displayed after it is saved.

Report the orders that really paid

Already a MyLeadDone client? Connect Meta Ads from your Integrations page. New to MyLeadDone? Start with 10 free orders — phone confirmation, delivery tracking and delivered-order reporting to Meta in one workflow.

Start Free

Sources

This article describes the MyLeadDone Meta integration as shipped in September 2026. Meta-specific behavior is based on Meta's official documentation:

Stop losing orders to fake clicks and missed calls

MyLeadDone confirms every COD order by phone, in Darija, Arabic or French — and you only pay for orders that get delivered.

Start Free — 10 Orders

Ready to confirm more orders and deliver more?

Up to 4 calls a day for 3 days, then 7 days of delivery follow-up. Your first 10 orders are free.