Connecting Drupal Commerce to Branch
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. Branch's real job is the web-to-app seam — a person clicks a link in a browser, installs the app, and something has to carry the context across an install that destroys every cookie involved. The join between them succeeds or fails on one thing: whether the Branch link click identifier and the deferred deep link payload reaches the Drupal Commerce order before the conversion happens, because Branch can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Drupal Commerce to Branch: links in, orders out from the backend
Branch fits only a Drupal Commerce store with an app. Use Branch links in order emails and campaign links carrying product context through install. Post app purchases from the order placement hook to Branch's server-to-server events API, with your Drupal user ID as developer identity and the order number shared with any SDK event.
Branch only has a job here if your Drupal Commerce store has an app beside it and you want web traffic to land in that app. The seam runs both ways. Outbound, the links Drupal itself sends, such as order confirmation and shipping emails, can be Branch links so a customer with the app opens the order in the app rather than in a mobile browser. Inbound, a campaign click on a product page needs a Branch link that carries the product context through the install so the first app open shows that product, not the home screen.
Purchases should be reported once, from whichever system places the order. If the app checks out against Drupal's API, the order placement hook can post the purchase to Branch's server-to-server events API with the user identity and revenue, provided the app passed its Branch identity on the order. Set your Drupal user ID as the developer identity in the app so web and app activity resolve to one person.
The usual break is an app SDK purchase event plus a server event with no shared ID, which double-counts and then propagates to every partner Branch forwards to. Use the Drupal order number as the shared identifier. Web-only Drupal stores should skip Branch entirely.
Drupal Commerce → Branch · what breaks
Why this join usually fails — Drupal Commerce → Branch
- 01
The Branch link click identifier and the deferred deep link payload 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
The install that erases the campaign
Someone clicks a paid ad on the mobile web, hits the app store, installs, and opens the app as a brand new anonymous user. Without deferred deep linking that campaign produced an organic install, and the ad account shows nothing for a conversion it genuinely caused.
- 04
Nothing reconciles afterwards
Branch shows the attributed link and campaign on the event in its dashboard. Check that the install carries a link click rather than showing as organic, which is the failure this product exists to prevent.
Drupal Commerce → Branch · the fix
What working looks like — Drupal Commerce → Branch
The Branch link click identifier and the deferred deep link payload on every order
Conversions arriving in Branch
The event is attributed to the originating link and campaign, and forwarded to any configured downstream partners.
Reconciled against the source
Drupal Commerce → Branch · architecture
How Drupal Commerce and Branch 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
Branch needs a click to match
Branch needs the link click context matched to the app open, plus the event and its revenue. Without the deferred deep link payload there is nothing to join the install to.
- 3
The identifier is the bridge
The Branch link click identifier and the deferred deep link payload, 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
Branch deduplicates on the event identifier you supply. Firing a purchase from both the SDK and your server without a shared identifier double-counts, and Branch forwards to downstream partners, so the duplicate propagates.
Drupal Commerce → Branch · normal or broken
Working vs. broken, side by side — Drupal Commerce → Branch
Normal, not a fault
The Branch link click identifier and the deferred deep link payload present on the order
Sent from the Drupal Commerce order placement hook
Deduplicated correctly
Branch deduplicates on the event identifier you supply. Firing a purchase from both the SDK and your server without a shared identifier double-counts, and Branch forwards to downstream partners, so the duplicate propagates.
Reconciles with the source
Actually broken
The Branch link click identifier and the deferred deep link payload 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
Someone clicks a paid ad on the mobile web, hits the app store, installs, and opens the app as a brand new anonymous user. Without deferred deep linking that campaign produced an organic install, and the ad account shows nothing for a conversion it genuinely caused.
Nobody has reconciled it
Drupal Commerce → Branch · diagnose
Diagnostic order — Drupal Commerce → Branch
- 01
Count orders carrying the Branch link click identifier and the deferred deep link payload
- 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
Measure your organic install share and ask whether it is plausible
An implausibly large organic share is usually broken attribution rather than genuine word of mouth.
- 05
Read the match rate, not the success message
Branch shows the attributed link and campaign on the event in its dashboard. Check that the install carries a link click rather than showing as organic, which is the failure this product exists to prevent.
Drupal Commerce → Branch · prove
How it gets proven — Drupal Commerce → Branch
Source of truth
Drupal's commerce_order records in your own database, filtered to completed states.
- The Branch link click identifier and the deferred deep link payload confirmed present on a live order.
- Attributed installs and in-app purchases reconciled against your own user records, with the unattributed share stated.
- Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.
Drupal Commerce → Branch · free audit
What we check in the free audit
- Count orders carrying the Branch link click identifier and the deferred deep link payload
- Follow one real conversion end to end
- List the order states in use and agree which count as revenue
- Measure your organic install share and ask whether it is plausible
- 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 → Branch · when not to buy
When you don't need this — Drupal Commerce → Branch
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the Branch link click identifier and the deferred deep link payload.
- 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 app, or no web surface driving app installs, there is no seam here to bridge and the integration solves nothing.
Drupal Commerce → Branch · what we deliver
What gets built — Drupal Commerce → Branch
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 Branch
The Branch server-to-server events API, posted from your backend with the user identity and event data.
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 → Branch questions, answered
Only if it also has an app and you want web links and emails to open in it with context. Web-only stores get nothing from it.
One of them, not both. If the app checks out through Drupal's API, sending from the order placement hook with the order number as the identifier is the cleaner choice.
Almost always because the Branch link click identifier and the deferred deep link payload 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.
Branch stores the click context and replays it into the app on first open, which is how a marketing campaign survives an install. That handoff is probabilistic on iOS and increasingly constrained, so the deep link data can arrive incomplete or not at all — and when it does not, the user looks organic.
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.
Branch shows the attributed link and campaign on the event in its dashboard. Check that the install carries a link click rather than showing as organic, which is the failure this product exists to prevent.
More on Drupal Commerce → Branch
- Drupal Commerce → Google AdsConnecting Drupal Commerce to Google Ads
- Drupal Commerce → MetaConnecting Drupal Commerce to Meta Conversions API
- Drupal Commerce → GA4Connecting Drupal Commerce to GA4
RELATED GUIDES
Where Drupal Commerce → Branch fits in the rest of your tracking
- Concrete CMS → BranchConnecting Concrete CMS to Branch
- Statamic → BranchConnecting Statamic to Branch
- Webflow → BranchConnecting Webflow to Branch
- Drupal Commerce → AppsFlyerConnecting Drupal Commerce to AppsFlyer
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Craft → BranchConnecting Craft CMS to Branch
- Contentful → BranchConnecting Contentful to Branch
- Sitecore → BranchConnecting Sitecore to Branch
Free · 30 min
Get Drupal Commerce and Branch joined properly
Free30 minutesNo obligation
