Connecting Medusa to Branch
Medusa is a Node commerce engine you extend in your own codebase, which makes the conversion event a piece of application code — and therefore something that can be tested rather than hoped for. 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 Medusa 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
Medusa web and app storefronts bridged with Branch links
Put the Medusa cart ID in Branch's deferred deep link so a shopper moving from mobile web to the installed app keeps the same cart. Post purchases from a payment-capture subscriber through Branch's server-to-server events API with the stored identity and order currency. Test the web-cart to install to app checkout path end to end.
Branch earns its place when one Medusa backend serves both a web storefront and a native app, and shoppers move between them. The Medusa-specific win is carrying the cart: put the cart ID in the deferred deep link payload, so a shopper who builds a cart on mobile web, taps through to install the app and opens it lands on the same cart, which the app loads from the backend.
For revenue, post a purchase event from your subscriber on payment capture through Branch's server-to-server events API, with the customer identity the app set in Branch and the captured total in the order's currency. Store the identity or Branch's identifiers in cart metadata when the cart is created, so the subscriber can attach the order to the right user without asking the storefront.
The break is the shared cart itself. If the app creates a new cart instead of loading the one in the payload, the install still attributes, but the purchase belongs to a cart with none of the campaign context, and web-started orders completed in the app look like organic app sales. Test the full path, from web cart to install to app checkout, and confirm the order shows the original link in Branch.
Medusa → Branch · what breaks
Why this join usually fails — Medusa → Branch
- 01
The Branch link click identifier and the deferred deep link payload never reaches Medusa
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
- 02
Firing on order placed rather than payment captured
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
- 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.
Medusa → Branch · the fix
What working looks like — Medusa → 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
Medusa → Branch · architecture
How Medusa and Branch actually connect
- 1
Medusa holds the truth
Because you own the event handlers, the conversion can fire from the payment-captured event specifically rather than from whatever the frontend happened to render.
- 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 Medusa order.
- 4
The event source decides reliability
Send orders at payment capture, at the paid total.
- 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.
Medusa → Branch · normal or broken
Working vs. broken, side by side — Medusa → Branch
Normal, not a fault
The Branch link click identifier and the deferred deep link payload present on the order
Sent from a Medusa subscriber on order payment capture
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
The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created.
Sent from the browser
They are different events and the gap between them contains every failed and pending payment. Order-placed is the easier hook and the wrong one.
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
Medusa → Branch · diagnose
Diagnostic order — Medusa → 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
Check which event your subscriber listens to
One line of code, and it decides whether you are counting orders or counting money.
- 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.
Medusa → Branch · prove
How it gets proven — Medusa → Branch
Source of truth
Medusa orders by payment status, emitted from your own subscriber code.
- 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.
- Payment-captured orders reconciled against imported conversions.
Medusa → 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
- Check which event your subscriber listens to
- Measure your organic install share and ask whether it is plausible
- Read the match rate, not the success message
Checked against
Medusa orders by payment status, emitted from your own subscriber code.
Free30 minutesNo obligation
Medusa → Branch · when not to buy
When you don't need this — Medusa → 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 every payment method you accept is instant, the two events nearly coincide and the distinction costs more than it returns.
- If you have no app, or no web surface driving app installs, there is no seam here to bridge and the integration solves nothing.
Medusa → Branch · what we deliver
What gets built — Medusa → Branch
Identifier capture into Medusa
Write the identifier into cart metadata at first touch so it is carried onto the order automatically at completion.
Event source: a Medusa subscriber on order payment capture
Send orders at payment capture, at the paid total.
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
Refunds emit their own event and should reverse.
Written guarantee
95%+ tracking accuracy
Measured against Medusa orders by payment status, emitted from your own subscriber code.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Medusa → Branch questions, answered
Yes, if you include the cart ID in the deep link payload and the app loads that cart from your Medusa backend on first open.
From a subscriber on payment capture, using the identity stored in cart metadata, rather than an event fired from a confirmation screen.
Almost always because the Branch link click identifier and the deferred deep link payload never reached the Medusa order. The storefront is separate from the backend, and the identifier must be attached to the cart before the order is created. 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.
A Medusa subscriber on order payment capture. Send orders at payment capture, at the paid total.
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 Medusa → Branch
- Stripe → BranchConnecting Stripe to Branch
- PayPal → BranchConnecting PayPal to Branch
- Shopify → BranchConnecting Shopify to Branch
RELATED GUIDES
Where Medusa → Branch fits in the rest of your tracking
- Wix → BranchConnecting Wix Stores to Branch
- Braintree → BranchConnecting Braintree to Branch
- BigCommerce → BranchConnecting BigCommerce to Branch
- Medusa → AppsFlyerConnecting Medusa to AppsFlyer
- Jewelry ecommerceConversion tracking for jewelry ecommerce, measured in settled orders
- EDD → BranchConnecting Easy Digital Downloads to Branch
- Swell → BranchConnecting Swell to Branch
- WooCommerce → BranchConnecting WooCommerce to Branch
Free · 30 min
Get Medusa and Branch joined properly
Free30 minutesNo obligation
