Meta Conversions API (CAPI) in Morocco: the guide | ANIMA
2026 guide · Conversion tracking

Meta Conversions API: measure your sales when the pixel no longer sees everything

Why the pixel alone is no longer enough, how to set up the Conversions API on Shopify, WooCommerce or a custom site, avoid duplicates and adapt it to cash on delivery and WhatsApp.

Illustration — Meta Conversions API: measuring your sales when the pixel no longer sees everything

At a glance — Meta's Conversions API (CAPI) sends your sales and leads to Meta from your server or your store, in addition to the pixel. The pixel depends on the browser: ad blockers, cookies limited by Safari, network drops. Meta recommends using both, with the same event ID so nothing gets counted twice. In Morocco, the API is also how you report what the pixel never sees: the order delivered and paid for.

Updated October 25, 2026

Your Ads Manager doesn't show the same number of purchases as your store. Or it counts every click on “Order” as a “purchase,” while some cash-on-delivery packages come back refused. Either way, Meta is optimizing your campaigns on bad data. The Conversions API fixes part of the problem. Here's why the pixel alone is no longer enough, how to set it up, and how to adapt it to cash on delivery and WhatsApp orders.

Why isn't the Meta Pixel enough on its own anymore?

The pixel is a snippet of code that runs in the visitor's browser (see our guide The Meta Pixel: what it is and how to install it). So anything that gets in the browser's way gets in the pixel's way:

  • Ad blockers. Shopify's Help Center says it plainly: a browser-side blocker can stop the Meta Pixel from sharing data, while data sent server to server can't be blocked by those blockers.
  • Safari. Since 2019, Safari has capped the lifetime of cookies created by JavaScript at seven days, according to the WebKit blog. A visitor who comes back to buy ten days later may no longer be recognized.
  • iOS. Since iOS 14.5, in April 2021, apps must ask permission before tracking a user across other companies' apps and websites, according to Apple. This limits what Meta can connect between its apps and your website.
  • The network. Meta acknowledges that the pixel can lose events because of connection problems or page-loading errors (Meta's best practices). On a patchy 4G connection, the thank-you page doesn't always load.

What is the Conversions API, in practice?

It's a direct channel between your server, or your e-commerce platform, and Meta. Instead of waiting for the customer's browser to send “Purchase,” your system sends it, once the order is recorded.

Meta recommends using it in addition to the pixel and sending the same events through both channels (Meta). Each server event contains:

  • a name — Purchase, Lead, AddToCart, or a custom name;
  • the time it happened, which can be no more than seven days before it is sent, according to Meta's documentation;
  • a source: website, app, phone, store, messaging…;
  • a unique ID, for example the order number;
  • customer information, hashed, such as email and phone number, which helps Meta connect the purchase to the person who saw the ad.

How do you set up the Conversions API on your website?

Your websiteMethodEffort
ShopifyFacebook & Instagram app, “Enhanced” or “Maximum” data-sharing level: both use the Conversions API alongside the pixel (Shopify)Low
WooCommerceMeta for WooCommerce extension: the Conversions API is built in, with deduplication by event ID (WooCommerce)Low
Custom site, no developerConversions API Gateway, set up from Events Manager and hosted on your own cloud account (AWS or Google Cloud); its only cost is the cloud or partner fee (Meta)Medium
Custom site, with a developerDirect integration from your back officeHigh

Meta also says that an advertiser who already has a pixel and only sends web events can turn on the Conversions API from Events Manager, without hosting anything. We found no official list of the countries where this applies: check whether the option shows up in your account. And if your website needs rebuilding, build tracking in from the design stage, as in our website design service.

How do you avoid counting the same sale twice?

If the pixel and your server both send “Purchase” for the same order, Meta needs to know it's the same one. That's deduplication. The rule, according to Meta's documentation:

  • the event name is identical on both sides;
  • the ID sent by the pixel (eventID) is identical to the server's (event_id);
  • both reach the same pixel, less than 48 hours apart.

The simplest approach: use the order number as the ID, on both sides. Meta also accepts a method based on the event name and the fbp or external_id identifiers, but it generally only works if the browser event arrives first.

How do you improve event match quality?

In Events Manager, Meta scores the match quality of your server events out of 10: it shows how well your customer information lets it connect the event to an account (Meta). To raise it:

  • Send email and phone number, hashed. Meta lists email, phone number, IP address, first name and last name among the high-quality parameters.
  • Format Moroccan numbers. Meta asks you to include the country code and strip out symbols and the leading zero (Meta's rules): 06 12 34 56 78 becomes 212612345678 before hashing.
  • Pass fbc and fbp, the Meta identifiers stored in the browser, without hashing them.
  • Add an external_id, your customer ID, in the same format everywhere.

Cash on delivery and WhatsApp: what should you send to Meta?

This is where the Conversions API becomes truly useful in Morocco. The pixel sees a click on “Order.” It doesn't see the confirmation call, the refused package or the cash handed to the courier.

For cash on delivery

  • Keep the purchase event at the moment of the order: it's the fast signal Meta learns from.
  • Also send, from your back office, a custom server event when the order is delivered and paid, for example “DeliveredOrder,” with the order number and the amount collected.
  • Create a custom conversion on this event to see, campaign by campaign, how many orders actually end up paid.
  • Send it within seven days of delivery, or Meta will reject it.

For WhatsApp orders

Meta offers a Conversions API dedicated to messaging. It reports events such as Purchase, LeadSubmitted or OrderDelivered from conversations started by an ad that clicks through to WhatsApp, Messenger or Instagram, and lets you optimize click-to-WhatsApp ads for purchases, according to Meta's documentation. Three limits:

  • it goes through the WhatsApp API (Cloud API), usually via a partner: the WhatsApp Business app on its own isn't among the documented options;
  • matching on hashed data, without a click ID, is only open in certain countries, and Morocco isn't confirmed among them;
  • Meta doesn't deduplicate these events: it's up to you or your partner to do it.

To set up selling on WhatsApp in the first place, see our guide WhatsApp Business for selling in Morocco.

One last point: collecting and passing on a customer's phone number or email is processing of personal data. Law 09-08 requires the person's consent (Article 4) and regulates transfers abroad (Articles 43 and 44). Update your privacy policy and have the setup approved by your legal counsel.

💡 Before launching a campaign, place a real test order and open the “Test events” tab in Events Manager. You should see the purchase come in from both the browser and the server, with the same event ID.

Sources

Reliable tracking before you spend more

Tell us which platform your website runs on and how you get paid. We'll check your pixel and your Conversions API and send you a clear quote within 24 hours — accounts in your name, ad budget with no commission.

Prefer to write? WhatsApp: +212 705-969268

Frequently asked questions

What's the difference between the Meta Pixel and the Conversions API?

The pixel sends events from the visitor's browser: it depends on blockers, cookies and the connection. The Conversions API sends them from your server or your e-commerce platform, directly to Meta. The two complement each other.

Should you keep the pixel if you set up the Conversions API?

Yes. Meta recommends using the Conversions API in addition to the pixel and sending the same events through both channels, with the same event name and the same ID to avoid duplicates, according to its documentation.

How do you set up the Conversions API on Shopify or WooCommerce?

On Shopify, with the Facebook & Instagram app, by choosing the Enhanced or Maximum data-sharing level. On WooCommerce, with the Meta for WooCommerce extension, which includes the Conversions API and deduplication. For a custom site, with the Conversions API Gateway or an integration built by a developer.

Does the Conversions API work with cash on delivery?

Yes, and it's one of its best uses in Morocco. Keep the purchase event at the moment of the order, then send a custom event from your back office when the package is delivered and paid, within seven days. A custom conversion then shows the orders actually paid for, campaign by campaign.

Can you track sales made on WhatsApp?

Meta offers a Conversions API for messaging, which reports purchases from click-to-WhatsApp ads and lets you optimize for purchases. It goes through the WhatsApp API, usually via a partner. Some options are only open in certain countries: check whether they're available in Morocco.