Connecting Drupal Commerce to Meta Conversions API
Drupal Commerce is self-hosted commerce inside a CMS built for complex content, which means the store is one part of a much larger site you fully control. Meta's pixel loses a large share of conversions to Safari, ad blockers and iOS, and the Conversions API exists because of it. The join between them succeeds or fails on one thing: whether the fbc and fbp values reaches the Drupal Commerce order before the conversion happens, because Meta can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Drupal Commerce to Meta CAPI: order ID as the event_id
Use the Drupal Commerce order ID, known from the draft stage, as event_id on both the pixel Purchase and the Meta Conversions API Purchase sent from the place transition. Store customer IP, user agent, fbc and fbp at an earlier checkout step, since gateway notify requests lack them. Send at placement to stay within seven days.
Drupal Commerce creates the order record as a draft during checkout, before payment, so you know its ID before the customer ever reaches the thank-you page. Use it as the event_id on both sides: the pixel Purchase rendered on the complete step and the Conversions API Purchase sent from an event subscriber on the place transition. If the complete page is cached or never runs, the server event still lands; if both arrive, Meta deduplicates on event_name plus event_id.
The Meta-specific detail is browser context. Website events carry client_ip_address and client_user_agent, and Meta leans on them for matching. In a normal checkout those come from the customer's own request to Drupal, along with the _fbc and _fbp cookies. With an off-site gateway the place transition may run on the gateway's notify request, which holds the payment provider's IP and none of the customer's cookies. Store the IP, user agent, fbc and fbp on the order at an earlier checkout step and send those, not whatever the notify request contains.
B2B stores often place orders that staff validate days later. Send Purchase at placement, not at validation, so event_time stays inside Meta's seven-day window. If you use the contributed Facebook Pixel module, check whether its current release sends server events at all before assuming it does.
Drupal Commerce → Meta · what breaks
Why this join usually fails — Drupal Commerce → Meta
- 01
The fbc and fbp values never reaches Drupal Commerce
Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.
- 02
Configurable workflow states nobody agreed on
Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.
- 03
Double counting from broken deduplication
Server and browser both fire, the event_id does not match, and Meta counts two purchases. Reported ROAS goes up, the business does not, and it can run for months before anyone reconciles against the store.
- 04
Nothing reconciles afterwards
Events Manager shows received events, the deduplication state and an Event Match Quality score per event. Events arriving is not the test — deduplicated, well-matched events arriving is. Compare Meta's reported purchases against your store's order count for the same window.
Drupal Commerce → Meta · the fix
What working looks like — Drupal Commerce → Meta
The fbc and fbp values on every order
Conversions arriving in Meta
Events appear in Events Manager with an Event Match Quality score, deduplicated against the pixel, and become usable for optimization and attribution.
Reconciled against the source
Drupal Commerce → Meta · architecture
How Drupal Commerce and Meta actually connect
- 1
Drupal Commerce holds the truth
You own the database, so the truth is exactly as good as the query. Pin down which order states count as revenue before comparing anything — Drupal's workflow states are configurable per install, so no two sites agree by default.
- 2
Meta Conversions API needs a click to match
Meta matches server events to people using whatever identifiers you send, hashed with SHA-256 where required. There is no single mandatory key, which is why quality varies so much between implementations — a poorly matched event is accepted, reported, and worth much less than it appears.
- 3
The identifier is the bridge
The fbc and fbp values, captured at the visit and carried into the Drupal Commerce order.
- 4
The event source decides reliability
Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
- 5
Deduplication at the destination
Meta deduplicates on the pair of event_name and event_id. The browser pixel and the server event must send the same event_id for the same conversion, within the deduplication window. Get this wrong and every purchase counts twice — which is by far the most common Conversions API failure and it inflates reported ROAS rather than reducing it.
Drupal Commerce → Meta · normal or broken
Working vs. broken, side by side — Drupal Commerce → Meta
Normal, not a fault
The fbc and fbp values present on the order
Sent from the Drupal Commerce order placement hook
Deduplicated correctly
Meta deduplicates on the pair of event_name and event_id. The browser pixel and the server event must send the same event_id for the same conversion, within the deduplication window. Get this wrong and every purchase counts twice — which is by far the most common Conversions API failure and it inflates reported ROAS rather than reducing it.
Reconciles with the source
Actually broken
The fbc and fbp values missing on most records
Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.
Sent from the browser
Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.
Counted twice, or not at all
Server and browser both fire, the event_id does not match, and Meta counts two purchases. Reported ROAS goes up, the business does not, and it can run for months before anyone reconciles against the store.
Nobody has reconciled it
Drupal Commerce → Meta · diagnose
Diagnostic order — Drupal Commerce → Meta
- 01
Count orders carrying the fbc and fbp values
- 02
Follow one real conversion end to end
- 03
List the order states in use and agree which count as revenue
Do this before any technical work — it resolves more Drupal Commerce disputes than any code change.
- 04
Read Event Match Quality and the deduplication indicator
In Events Manager, open the event and check both. A low match quality means weak identifiers; a missing deduplication indicator means your event_id pairing is broken.
- 05
Read the match rate, not the success message
Events Manager shows received events, the deduplication state and an Event Match Quality score per event. Events arriving is not the test — deduplicated, well-matched events arriving is. Compare Meta's reported purchases against your store's order count for the same window.
Drupal Commerce → Meta · prove
How it gets proven — Drupal Commerce → Meta
Source of truth
Drupal's commerce_order records in your own database, filtered to completed states.
- The fbc and fbp values confirmed present on a live order.
- Deduplication confirmed in Events Manager on a real purchase, with the browser and server events visibly paired rather than counted twice.
- Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.
Drupal Commerce → Meta · free audit
What we check in the free audit
- Count orders carrying the fbc and fbp values
- Follow one real conversion end to end
- List the order states in use and agree which count as revenue
- Read Event Match Quality and the deduplication indicator
- Read the match rate, not the success message
Checked against
Drupal's commerce_order records in your own database, filtered to completed states.
Free30 minutesNo obligation
Drupal Commerce → Meta · when not to buy
When you don't need this — Drupal Commerce → Meta
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the fbc and fbp values.
- If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
- If you are not running Meta ads at meaningful spend, the Conversions API is effort without payoff. It earns its cost when the optimization signal is worth improving.
Drupal Commerce → Meta · what we deliver
What gets built — Drupal Commerce → Meta
Identifier capture into Drupal Commerce
Capture the identifier and persist it as order field data through a hook on order placement, server-side, so it never depends on what the cache served.
Event source: the Drupal Commerce order placement hook
Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
Dispatch to Meta
Server-side events to the Conversions API with the event_id matched to the pixel, action_source set correctly, and customer data hashed before it leaves your infrastructure.
Reversals where they exist
Order state transitions to refunded or cancelled are recorded and can drive reversals.
Written guarantee
95%+ tracking accuracy
Measured against Drupal's commerce_order records in your own database, filtered to completed states.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Drupal Commerce → Meta questions, answered
Check the module's current release notes for your Drupal version. Many setups run the module for the browser pixel and add server events from a custom subscriber on order placement.
The order ID or order number, which exists from the draft stage. Use the same value in the pixel Purchase and the Conversions API Purchase.
Almost always because the fbc and fbp values never reached the Drupal Commerce order. Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run. Measure coverage before debugging the dispatch.
Two things. The _fbc cookie, derived from the fbclid parameter on the landing URL in the format fb.1.<timestamp>.<fbclid>, is the click identifier. The _fbp cookie is the browser identifier. Beyond those, Meta matches on hashed customer information — email, phone, name, city, country — and every additional field raises the Event Match Quality score. Unlike Google, Meta does not need a click ID at all if the customer data is good, but match quality drops noticeably without it.
The Drupal Commerce order placement hook. Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.
Events Manager shows received events, the deduplication state and an Event Match Quality score per event. Events arriving is not the test — deduplicated, well-matched events arriving is. Compare Meta's reported purchases against your store's order count for the same window.
More on Drupal Commerce → Meta
- Squarespace → MetaConnecting Squarespace Commerce to Meta Conversions API
- Drupal Commerce → Google AdsConnecting Drupal Commerce to Google Ads
- Drupal Commerce → GA4Connecting Drupal Commerce to GA4
RELATED GUIDES
Where Drupal Commerce → Meta fits in the rest of your tracking
- Meta · Local servicesMeta Ads conversion tracking for local service businesses
- Meta · B2BMeta Ads conversion tracking for B2B companies
- Meta × CRM DealsHow to reconcile Meta Ads against your CRM's closed-won deals
- Meta · Comparison page → demoHow to track comparison page visit to demo request for Meta Ads
- AEM → MetaConnecting Adobe Experience Manager to Meta Conversions API
- Drupal Commerce → Google AdsConnecting Drupal Commerce to Google Ads
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Umbraco → MetaConnecting Umbraco to Meta Conversions API
Free · 30 min
Get Drupal Commerce and Meta joined properly
Free30 minutesNo obligation
