Skip to main content
Drupal Commerce → BrazeIntegration guide

Connecting Drupal Commerce to Braze

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. Braze is mobile-first lifecycle messaging, which means it resolves to a user rather than to a click and its most valuable channels — push and in-app — exist nowhere near a browser. The join between them succeeds or fails on one thing: whether the Braze external user ID reaches the Drupal Commerce order before the conversion happens, because Braze can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Drupal Commerce to Braze: guest orders have no user ID

Drupal Commerce assigns guest orders to uid 0, so never use it as a Braze external_id. Key registered customers on their Drupal uid and handle guests by email lookup or later registration. Send line-item purchases from the order placement hook to Braze's user track endpoint with variation SKUs. Justified only with an app.

Braze wants an external_id, and the obvious choice is the Drupal user ID. The catch is guest checkout: Drupal Commerce assigns guest orders to the anonymous user, uid 0, so every guest order shares one meaningless ID. Send that to Braze and you have one enormous fake user. Decide the rule up front: registered customers use their Drupal uid as external_id, and guest orders either use a lookup on email or wait until the guest creates an account, which Drupal Commerce can attach their earlier orders to.

Send the placed order from the order placement hook to Braze's user track endpoint as a purchase per line item, using the product variation SKU as the product ID, with price and currency. Line-item purchases are what let a Braze campaign say "you bought X" without guessing from the confirmation page, which on Drupal may be a cached render anyway.

Braze's value is push and in-app, so this pair only justifies itself if there is an app and the app identifies users with the same Drupal uid. If the app logs purchases through the Braze SDK as well, turn one off; two purchase events trigger two campaigns. Cancellations should update a custom attribute or send a cancellation event so post-purchase messages stop.

Drupal Commerce → Braze · what breaks

Why this join usually fails — Drupal Commerce → Braze

  1. 01

    The Braze external user ID 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

    Duplicate events sending duplicate push notifications

    A duplicate here is visible to your customer on their lock screen, twice, and the second one is the reason they turn push off permanently. This is a more expensive mistake than a double-counted conversion in an ad platform, because the damage is not recoverable.

  4. 04

    Nothing reconciles afterwards

    Braze shows events on the user profile within moments. Check the profile, not the API response, and specifically check whether an anonymous device profile has been created alongside the real one.

Drupal Commerce → Braze · the fix

What working looks like — Drupal Commerce → Braze

  • The Braze external user ID on every order

  • Conversions arriving in Braze

    The event lands on the user profile, triggers whatever campaigns depend on it, and becomes available for segmentation across push, email and in-app.

  • Reconciled against the source

Drupal Commerce → Braze · architecture

How Drupal Commerce and Braze 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

    Braze needs a click to match

    Braze needs the external user ID and a well-named event with its properties. An event with no external ID lands on an anonymous device profile that may never merge with the real user.

  3. 3

    The identifier is the bridge

    The Braze external user ID, 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

    Braze does not deduplicate for you. A purchase sent from both your app SDK and your server produces two events, two campaign triggers and potentially two push notifications to a customer who bought once.

Drupal Commerce → Braze · normal or broken

Working vs. broken, side by side — Drupal Commerce → Braze

Normal, not a fault

  • The Braze external user ID present on the order

  • Sent from the Drupal Commerce order placement hook

  • Deduplicated correctly

    Braze does not deduplicate for you. A purchase sent from both your app SDK and your server produces two events, two campaign triggers and potentially two push notifications to a customer who bought once.

  • Reconciles with the source

Actually broken

  • The Braze external user ID 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

    A duplicate here is visible to your customer on their lock screen, twice, and the second one is the reason they turn push off permanently. This is a more expensive mistake than a double-counted conversion in an ad platform, because the damage is not recoverable.

  • Nobody has reconciled it

Drupal Commerce → Braze · diagnose

Diagnostic order — Drupal Commerce → Braze

  1. 01

    Count orders carrying the Braze external user ID

  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

    Send a test purchase and read the user profile's event stream

    One event or two? Check whether the SDK is already sending the same event before adding a server source, and check that the external ID matches the signed-in user rather than creating a new profile.

  5. 05

    Read the match rate, not the success message

    Braze shows events on the user profile within moments. Check the profile, not the API response, and specifically check whether an anonymous device profile has been created alongside the real one.

Drupal Commerce → Braze · prove

How it gets proven — Drupal Commerce → Braze

Source of truth

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

  • The Braze external user ID confirmed present on a live order.
  • The user profile confirmed to show one event per conversion, with device and user profiles correctly merged.
  • Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.

Drupal Commerce → Braze · free audit

What we check in the free audit

  • Count orders carrying the Braze external user ID
  • Follow one real conversion end to end
  • List the order states in use and agree which count as revenue
  • Send a test purchase and read the user profile's event stream
  • 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 → Braze · when not to buy

When you don't need this — Drupal Commerce → Braze

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Braze external user ID.
  • If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
  • If you have no mobile app and no push channel, Braze is a large piece of infrastructure for a job an email platform already does.

Drupal Commerce → Braze · what we deliver

What gets built — Drupal Commerce → Braze

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

    The Braze user track endpoint, posted server-side from your order or billing system with the external user ID and event properties.

  • 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 → Braze questions, answered

The Drupal user ID for registered customers. Guest orders all belong to uid 0, so handle them by email lookup or wait until the guest registers.

Free · 30 min

Get Drupal Commerce and Braze joined properly

Free30 minutesNo obligation