Skip to main content
Craft → BranchIntegration guide

Connecting Craft CMS to Branch

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

Craft CMS to Branch: content URLs that open the app

Map Craft entry URIs to app routes, putting the entry ID in Branch link data so renamed slugs still resolve; Branch's smart banner goes in the base layout. Website Commerce orders aren't Branch conversions. Only app orders against a headless Craft Commerce backend should post server-side from the order-complete listener with the order reference.

Branch belongs on a Craft site when the brand also has an app and wants web visitors to end up in it. The practical work is URL mapping: Craft content lives at entry URIs set by each section's URI format, and the app needs a route for each kind of entry. Branch's deep links carry that context through the install, so a visitor reading an article on the web opens the same article in the app.

That mapping breaks when an editor changes a section's URI format or renames a slug, which Craft makes easy and the app team never hears about. Put the entry ID in the Branch link data rather than relying on the URI, so a renamed entry still resolves in the app. Branch's smart banner or Journeys script goes in the base layout and is unaffected by static caching.

Commerce orders placed on the Craft website are not Branch conversions and should go to your web ad platforms. Orders placed in the app against a headless Craft Commerce backend can be posted to Branch server-side from the order-complete listener, with the user's identity and the order reference as the event identifier. If the app SDK already logs purchases, choose one source, because Branch forwards both to its partners.

Craft → Branch · what breaks

Why this join usually fails — Craft → Branch

  1. 01

    The Branch link click identifier and the deferred deep link payload 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

    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.

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

Craft → Branch · the fix

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

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

Craft → Branch · architecture

How Craft and Branch 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

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

    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.

Craft → Branch · normal or broken

Working vs. broken, side by side — Craft → Branch

Normal, not a fault

  • The Branch link click identifier and the deferred deep link payload 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

    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

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

Actually broken

  • The Branch link click identifier and the deferred deep link payload 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

    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

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

Craft → Branch · diagnose

Diagnostic order — Craft → Branch

  1. 01

    Count orders carrying the Branch link click identifier and the deferred deep link payload

  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

    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.

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

Craft → Branch · prove

How it gets proven — Craft → Branch

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

Craft → 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
  • Read how this specific build handles order completion
  • Measure your organic install share and ask whether it is plausible
  • 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 → Branch · when not to buy

When you don't need this — Craft → Branch

  • If Branch 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 Branch link click identifier and the deferred deep link payload.
  • If the original agency is still engaged, the fastest path is usually specifying the field and having them add the hook.
  • If you have no app, or no web surface driving app installs, there is no seam here to bridge and the integration solves nothing.

Craft → Branch · what we deliver

What gets built — Craft → Branch

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

    The Branch server-to-server events API, posted from your backend with the user identity and event data.

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

Map each Craft section to an app route and pass the entry ID in the Branch link data, so renamed slugs still resolve. Put the Branch web script in the base layout template.

Free · 30 min

Get Craft and Branch joined properly

Free30 minutesNo obligation