Skip to main content
Drupal Commerce → Customer.ioIntegration guide

Connecting Drupal Commerce to Customer.io

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. Customer.io triggers messages from behaviour, which means an event you send is not recorded — it is acted on, usually within seconds, by sending something to a real person. The join between them succeeds or fails on one thing: whether the person identifier you assign reaches the Drupal Commerce order before the conversion happens, because Customer.io can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Drupal Commerce to Customer.io: abandoned carts are draft orders

A Drupal Commerce cart is a draft order, so send checkout started to Customer.io when an email is first set on the draft, with items and total, and order placed once from the placement hook. Make the purchase a campaign exit condition for late gateway notifications, and key people by email, not order ID.

In Drupal Commerce a cart is a commerce_order in the draft state, and once the shopper types an email in the checkout's contact information step, that draft order carries it. That is the clean source for Customer.io's cart and checkout events: send a checkout started event when the email is first set on a draft order, keyed on that email or your person ID, with the cart's items and total, and send order placed from the placement hook when the order leaves draft.

Build the campaign so the purchase is an exit condition, not just a separate trigger. If a shopper completes payment through an offsite gateway and the order is placed by the gateway's notification a minute later, a campaign without an exit condition can still send the abandoned cart email to someone who just paid. Customer.io does not deduplicate, so the placed event must be sent exactly once per order.

Two Drupal details cause most of the mess. The email may only be set at a later checkout step, so short checkouts never fire the started event. And carts can be deleted by Drupal's cart expiration settings, so a shopper who returns after expiry starts a new draft order; do not use the order ID as the person identifier. Use email or a stable person ID across both.

Drupal Commerce → Customer.io · what breaks

Why this join usually fails — Drupal Commerce → Customer.io

  1. 01

    The person identifier you assign 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.

  2. 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.

  3. 03

    A test event sending a real email

    Because campaigns evaluate on arrival, there is no safe place to test in production. A malformed purchase event fired during development against a live workspace will send a real order confirmation to a real person, and that cannot be recalled.

  4. 04

    Nothing reconciles afterwards

    Customer.io shows the event and the resulting campaign activity on the person's timeline. Check what the event triggered, not just that it arrived.

Drupal Commerce → Customer.io · the fix

What working looks like — Drupal Commerce → Customer.io

  • The person identifier you assign on every order

  • Conversions arriving in Customer.io

    The event lands on the person, evaluates against every campaign trigger and segment condition, and may send immediately.

  • Reconciled against the source

Drupal Commerce → Customer.io · architecture

How Drupal Commerce and Customer.io actually connect

  1. 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. 2

    Customer.io needs a click to match

    Customer.io needs the person identifier, the event name and any attributes the campaign conditions reference. An event whose attributes are missing will still trigger a campaign, which may then send a message with an empty placeholder in it.

  3. 3

    The identifier is the bridge

    The person identifier you assign, captured at the visit and carried into the Drupal Commerce order.

  4. 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. 5

    Deduplication at the destination

    Customer.io does not deduplicate events. A purchase sent twice can enter a workflow twice and send two emails, and unlike a reporting duplicate the customer sees this one.

Drupal Commerce → Customer.io · normal or broken

Working vs. broken, side by side — Drupal Commerce → Customer.io

Normal, not a fault

  • The person identifier you assign present on the order

  • Sent from the Drupal Commerce order placement hook

  • Deduplicated correctly

    Customer.io does not deduplicate events. A purchase sent twice can enter a workflow twice and send two emails, and unlike a reporting duplicate the customer sees this one.

  • Reconciles with the source

Actually broken

  • The person identifier you assign 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

    Because campaigns evaluate on arrival, there is no safe place to test in production. A malformed purchase event fired during development against a live workspace will send a real order confirmation to a real person, and that cannot be recalled.

  • Nobody has reconciled it

Drupal Commerce → Customer.io · diagnose

Diagnostic order — Drupal Commerce → Customer.io

  1. 01

    Count orders carrying the person identifier you assign

  2. 02

    Follow one real conversion end to end

  3. 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.

  4. 04

    Confirm which workspace you are writing to before sending anything

    Environment separation is the whole safety mechanism in behaviour-triggered tools, and it is the thing most often skipped.

  5. 05

    Read the match rate, not the success message

    Customer.io shows the event and the resulting campaign activity on the person's timeline. Check what the event triggered, not just that it arrived.

Drupal Commerce → Customer.io · prove

How it gets proven — Drupal Commerce → Customer.io

Source of truth

Drupal's commerce_order records in your own database, filtered to completed states.

  • The person identifier you assign confirmed present on a live order.
  • Events confirmed on person profiles with the triggered campaign activity verified, in a test workspace before production.
  • Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.

Drupal Commerce → Customer.io · free audit

What we check in the free audit

  • Count orders carrying the person identifier you assign
  • Follow one real conversion end to end
  • List the order states in use and agree which count as revenue
  • Confirm which workspace you are writing to before sending anything
  • Read the match rate, not the success message

Checked against

Drupal's commerce_order records in your own database, filtered to completed states.

Get my free conversion tracking audit

Free30 minutesNo obligation

Drupal Commerce → Customer.io · when not to buy

When you don't need this — Drupal Commerce → Customer.io

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the person identifier you assign.
  • If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
  • If your messaging is scheduled rather than behavioural, a simpler email platform does the job and removes the whole class of accidental-send risk.

Drupal Commerce → Customer.io · what we deliver

What gets built — Drupal Commerce → Customer.io

  • 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 Customer.io

    The Customer.io Track API, posted server-side from your order or product system with the person identifier and event attributes.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Drupal Commerce → Customer.io questions, answered

Treat a draft order with an email set as the checkout started event, and send the placed order as the exit condition. Key both on the same person identifier.

Free · 30 min

Get Drupal Commerce and Customer.io joined properly

Free30 minutesNo obligation