Skip to main content
Craft → Customer.ioIntegration guide

Connecting Craft CMS to Customer.io

Craft is a developer-oriented CMS, usually built bespoke by an agency, which means the implementation is whatever that agency decided and nothing is standard. 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 Craft 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

Craft Commerce to Customer.io: keep staging out of live

Keep Customer.io credentials in each Craft environment's .env, point staging at a separate workspace and gate the listener on the environment setting. Send purchases from the order-complete listener with a standardized person identifier, and cart events for idle incomplete Commerce orders from a scheduled job, using the same order ID so buyers exit abandonment campaigns.

The Customer.io risk on a Craft build is environments. Craft sites run dev, staging and production from one codebase with settings in .env files, and staging is routinely refreshed from a production database copy, real customer emails included. If the Customer.io site ID and API key are hard-coded in a config file instead of read from the environment, every test order on staging fires a real order confirmation to a real customer.

Put the credentials in .env per environment, point staging at a separate Customer.io workspace, and gate the sending listener on Craft's environment setting as a second guard. Then send purchases from the order-complete listener with the person identifier you have standardized on (email works if you lowercase it; the Craft user UID is more stable) and the attributes your campaigns reference: order reference, total, items, shipping method.

Abandoned-cart campaigns are where Craft helps: incomplete Commerce orders are stored carts with an email once the customer enters one, so a scheduled job can send a cart event for carts idle past your threshold. Send the purchase from the same order with the same order ID, so it exits the person from the abandonment campaign instead of leaving them in it to receive a reminder about something they bought.

Craft → Customer.io · what breaks

Why this join usually fails — Craft → Customer.io

  1. 01

    The person identifier you assign never reaches Craft

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  2. 02

    Every install is bespoke

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  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.

Craft → Customer.io · the fix

What working looks like — Craft → 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

    Craft CMS's own records are the reference, not either dashboard.

Craft → Customer.io · architecture

How Craft and Customer.io actually connect

  1. 1

    Craft CMS holds the truth

    Craft installs are bespoke by nature. Establish how this particular build models a completed order before assuming anything transfers from another Craft site.

  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 Craft Commerce order.

  4. 4

    The event source decides reliability

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  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.

Craft → Customer.io · normal or broken

Working vs. broken, side by side — Craft → Customer.io

Normal, not a fault

  • The person identifier you assign present on the order

    Visible on the record itself in Craft CMS, not merely captured somewhere on the site.

  • Sent from the Craft Commerce order-complete event

  • 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

    Customer.io's count and Craft CMS's records agree within a few percent over a closed window.

Actually broken

  • The person identifier you assign missing on most records

    Craft's template caching and static caching plugins both serve stored output, and because every build is custom, where the capture code lives differs per site. There is no standard place to look.

  • Sent from the browser

    There is no standard Craft setup, so an approach that worked on another Craft site may have nothing to attach to on this one. Read the build before quoting.

  • 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

    The dashboard shows a number and no one has compared it to Craft CMS.

Craft → Customer.io · diagnose

Diagnostic order — Craft → Customer.io

  1. 01

    Count orders carrying the person identifier you assign

  2. 02

    Follow one real conversion end to end

  3. 03

    Read how this specific build handles order completion

    Assumptions carried from another Craft project are the main source of wasted time here.

  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.

Craft → Customer.io · prove

How it gets proven — Craft → Customer.io

Against Craft CMS's own records, not against either platform's dashboard.

Source of truth

Craft Commerce's order records in your own database, filtered to completed.

  • 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 custom field confirmed populated on an order placed as an anonymous visitor through cache.

Craft → 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
  • Read how this specific build handles order completion
  • Confirm which workspace you are writing to before sending anything
  • Read the match rate, not the success message

Checked against

Craft Commerce's order records in your own database, filtered to completed.

Get my free conversion tracking audit

Free30 minutesNo obligation

Craft → Customer.io · when not to buy

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

  • If Customer.io already reports conversions that reconcile against Craft CMS's records within a few percent, this join is working and there is nothing to buy.
  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the person identifier you assign.
  • If the original agency is still engaged, the fastest path is usually specifying the field and having them add the hook.
  • If your messaging is scheduled rather than behavioural, a simpler email platform does the job and removes the whole class of accidental-send risk.

Craft → Customer.io · what we deliver

What gets built — Craft → Customer.io

  • Identifier capture into Craft

    Capture the identifier and store it as a custom field on the order through a Craft event listener, server-side.

  • Event source: the Craft Commerce order-complete event

    Fire from the event listener in PHP rather than a Twig template, which may be cached.

  • 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

    Refunds and cancelled orders are recorded against the order.

Written guarantee

95%+ tracking accuracy

Measured against Craft Commerce's order records in your own database, filtered to completed.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Craft → Customer.io questions, answered

Load Customer.io credentials from each environment's .env, give staging its own workspace, and check Craft's environment before sending. Staging databases copied from production contain real emails.

Free · 30 min

Get Craft and Customer.io joined properly

Free30 minutesNo obligation