Skip to content

Branch for deep linking

Branch is a mobile linking platform used to acquire, engage, and measure across devices, channels, and platforms by providing a holistic view of user touchpoints.

This integration is maintained by Branch.

About the integration

The Braze and Branch integration allows you to provide better experiences to your customers by allowing you to properly attribute the beginning of their user journey and connect them through deep links to their intended location.

Integration

Follow Branch’s SDK integration guide to get up and running with your Branch integration. Refer to the following for additional use cases.

To support sending iOS universal links as deep links from within Braze:

Follow Branch’s documentation for setting up universal links. As part of this setup, Branch hosts the AASA file on your Branch link domain (for example, yourapp.app.link) automatically.

Step 2: Configure Associated Domains

In Xcode, go to your app target > Signing & Capabilities and add your Branch link domain under Associated Domains:

1
2
applinks:yourapp.app.link
applinks:yourapp-alternate.app.link

If you use a custom Branch domain, add that as well.

Set forwardUniversalLinks to true in your Braze SDK configuration so the SDK forwards universal links to your app’s AppDelegate:

1
2
3
let configuration = Braze.Configuration(apiKey: "<BRAZE_API_KEY>", endpoint: "<BRAZE_ENDPOINT>")
configuration.forwardUniversalLinks = true
let braze = Braze(configuration: configuration)
1
2
3
4
BRZConfiguration *configuration = [[BRZConfiguration alloc] initWithApiKey:@"<BRAZE_API_KEY>"
                                                                  endpoint:@"<BRAZE_ENDPOINT>"];
configuration.forwardUniversalLinks = YES;
Braze *braze = [[Braze alloc] initWithConfiguration:configuration];

Implement BrazeDelegate to intercept Branch links before Braze handles them. This ensures Branch can process the link and perform its own routing:

1
2
3
4
5
6
7
8
9
10
func braze(_ braze: Braze, shouldOpenURL context: Braze.URLContext) -> Bool {
  if let host = context.url.host,
     host.contains("app.link") || host.contains("yourdomain.com") {
    // Let Branch handle this link
    Branch.getInstance.handleDeepLink(context.url)
    return false
  }
  // Let Braze handle all other links
  return true
}
1
2
3
4
5
6
7
8
- (BOOL)braze:(Braze *)braze shouldOpenURL:(BRZURLContext *)context {
  NSString *host = context.url.host;
  if (host && ([host containsString:@"app.link"] || [host containsString:@"yourdomain.com"])) {
    [[Branch getInstance] handleDeepLink:context.url];
    return NO;
  }
  return YES;
}

Replace yourdomain.com with your custom Branch domain, if applicable.

Deep linking in email

Refer to the documentation on Universal links and App Links or see Branch’s documentation to set up deep linking from emails sent through Braze.

Linking to phone numbers (appending tel to href) isn’t supported in the Gmail app for iOS unless a user grants call permissions to the app.

Depending on your ESP, additional customization may be required to support click-tracked universal links. This information is outlined in our dedicated article. You can also refer to the following references to learn more:

Troubleshooting

If Branch links aren’t working as expected from Braze campaigns, follow these steps.

Open the Branch link from the Notes app on a physical iOS device. If it doesn’t open your app:

  • The issue is in your Branch or AASA configuration, not Braze.
  • Validate your Branch AASA at https://yourapp.app.link/.well-known/apple-app-site-association.
  • Check that your Bundle ID and Team ID match in the Branch dashboard.

Enable dual logging

  1. Braze: Enable verbose logging and look for Opening '<URL>': entries. This confirms the SDK received the link.
  2. Branch: Enable Branch test mode and check the Branch dashboard for link click events.
  3. Compare: If Braze logs the link but Branch doesn’t see a click, the BrazeDelegate routing logic is likely not intercepting the link correctly. Check that the domain match in shouldOpenURL includes your Branch domain.

Common issues

For more deep linking troubleshooting scenarios, see Deep linking troubleshooting.

New Stuff!