This guide will walk you through how to setup your email campaigns with Salesforce v3 using Branch Universal Email to automatically convert your email links into multi-platform deep links
The basic integration involves four parts:
- Activate integration and setup link behavior
- Configure your mobile app
- Configure your ESP
- Updating the links in your email
Universal Email allows you to automatically convert your email links into multi-platform deep links that take users directly to content in the app on mobile devices, while still maintaining the same web experience for desktop and mobile users without the app.
When a link is clicked by a user without the app, it will route that user to the original web URL (including on desktop). When a link is clicked by a user with your app, it will direct that user into the relevant in-app content regardless of platform or email client.
You must have the Sender Authentication Package activated and host your DNS Settings instead of delegating the domain to Salesforce. If you've already delegated your domain to Salesforce, please ask your account manager to change domain settings and send your DNS settings.
This guide requires you to have already integrated the Branch SDK into your app.
To open the app directly on iOS 9.2+, you must configure your email integration and your app to support Universal Links in emails.
Contact your Branch Account Manager or firstname.lastname@example.org at any time for assistance with the setup steps.
Choose your email service provider¶
Navigate to the Universal Email section of the Branch dashboard. Select Salesforce Marketing Cloud and click Enable.
Set up Email link behavior¶
Branch turns the web URLs you put into your emails into Branch deep links, opening the app for users with your app installed to that same content in the app.
To do this, it must be possible to map your web URL content (e.g. a page with brown loafers at
https://shop.com/shoes/brown-loafers) into a working deep link that takes users to brown loafers in the app. The Universal Email setup flow will attempt to automatically detect this mapping for you.
If you do not want to set this up yet, you can select No, just open to app homepage for now.
By default, email deep links will redirect users without your app to the same content on the web instead.
If you would like to send users to the App Store or another default you have specified in Link Settings, you can select Open to default redirects.
Checking your deep linking setup¶
If you chose not to set up deep linking to specific content within your app, then you can skip this step.
In this step, you will want to enter a web URL that corresponds to a specific screen within your app. In other words, the webpage should have content that also exists in your app. If you do not know whether your web content also exists in-app, try any URL other than your website homepage. Some examples:
- A product page, like a page with brown loafers
- An article
- A content page, like a video or image
Once you choose one and click Submit, meta tags that can be used for deep linking will be retrieved from your webpage. You will see a result indicating the mapping between your web content and your app content. For a full explanation of the tests run on this page and the possible results, check out the support section.
We couldn't determine your deep linking setup¶
If an app deep linking scheme that maps to your web content cannot be successfully detected, you can configure your settings manually, or you can reach out to your Branch account manager or support for assistance.
We will help you set up one of the following methods:
If you use unique key/value data as deep link values:
- Recommended: Hosted deep link data: You can host your deep link data on your website with a metatag that looks like this
<meta name="branch:deeplink:my_key" content="my_value" />where
my_valuewill become a key value pair in deep link data. For each web URL, Branch will look for those tags and embed the deep link data (if found) into the deep link. Note that Branch also accepts App Links tags for deep linking. For more details, please read Hosted Deep Link Data.
- As query parameters: Simply append query parameters on to your web url and Branch will take those parameters and put them in deep link data.
If you use your web URL as a deep link value:
- URL path: If you use the path of your web URL as your
$deeplink_pathvalue, or any other deep link value, then the configuration will automatically take the path of the URL and put it in deep link data.
- Full URL: If you use the full web URL as your
$deeplink_pathvalue, or any other deep link value, then the configuration will take the entire URL and put it in deep link data.
Host deep link data for more than just emails
Deep linking settings for email¶
The following are all the possible settings you can configure for deep linking with email.
|Setting||Example||Link Data Result|
|Open the app homepage||No settings configured to generate deep link data for email; email links will route to the app homepage.|
|Open to specific app content||Deep link to specific app content based on one or more of the following settings.|
|Translate query parameters on URLs into Branch link data||URL:
|Translate web URL into Branch link data:
Full URL for key ______
|Translate web URL into Branch link data:
URL path for key ______
|Retrieve hosted deep link data from website and translate into Branch link data||URL:
|Strip protocol (http:// or https://):
Note: Typically used with one of the other settings.
Other Settings: Translate web URL into Branch link data: Full URL for key
|Translate query parameters on URLs into Branch link data from parameter ______ to key ______
Note: Not configurable in the UI. Contact support to use this setting.
Link behavior for users without your app¶
|Open to specific web content||Route to the original URL specified in the email.|
|Open to default redirects||Route to defaults specified in Link Settings.|
Tell us your click tracking domain¶
You can retrieve your click tracking domain from the [Authenticated Domains] section of your settings at Salesforce Marketing Cloud account. If you have not added a custom click tracking domain yet, follow the instructions here.
You will also need to register your Salesforce Data Domain (retrieved from your Salesforce account manager), which is the domain Salesforce uses to collect click data.
Configure your app for your click tracking domain¶
You can send ESP configuration to your development team
In this prompt, enter the email of someone on your team who is qualified to modify your iOS app, and then click Send. They will complete the technical setup steps below.
Click Next to proceed to Validate and test the integration
Validate and Test¶
The last step of the Universal Email setup flow validates whether you have completed all necessary steps and whether an engineer on your team has completed the integration steps. You will also see recommendations for how to improve your email integration.
Once it's done the AASA file and SSL certificate - required for Universal Links - specific to that domain will be generated.
The conversion to Branch links will only work when your links are wrapped in your click tracking domain. To test links without wrapping, please generate a test link on the Verification step of email onboarding, also accessible by clicking the gear icon for your ESP on the email page.
What happens to your links behind the scenes?
This is what a link looks like within your email template:
When a user clicks your link, Branch processes the link and converts it to something like this:
vza3.app.link is your Branch domain.
Configure your mobile app¶
The following app changes ensure that your email integration supports Universal Links. You will need access to your app code to make these changes.
How does it work?
Apple recognizes the click tracking domain as a Universal Link, and opens the app immediately without the browser opening. Once the app has opened, Branch will collect the referring URL that opened the app (at this time, it will be the click tracking url). Inside the app, Branch will robotically “click” the link, registering the click with the ESP, and returning the Branch link information to the Branch SDK inside the app. This information is then used to deep link the user to the correct in-app content. See the Support section for more information.
Add your click tracking domain to your Associated Domains¶
To enable Universal Links on your click tracking domain, you'll need to add the click tracking domain to your Associated Domains entitlement.
- In Xcode, go to the
Capabilitiestab of your project file.
Scroll down and enable
Associated Domainsif it is not already enabled.
Copy your click tracking domain from the email you received from Branch, or retrieve it from your ESP's settings.
Domainssection, click the
+icon and add your click tracking domain. For example, if your click tracking domain is
email.example.com, add an entry for
Having trouble or new to Universal Links?
Follow these instructions for more details on enabling Universal Links in the Branch dashboard and in Xcode.
Return YES to continueUserActivity¶
When users enter your app via a Universal Link, we check to see to see if the link URL contains
app.link. If so,
handledByBranch will return
YES. If not,
handledByBranch will return
NO. This allows us to explicitly confirm the incoming link is from Branch without making a server call.
For most implementations this will never be an issue, since your deep links will be routed correctly either way. However, if you use a custom link domain and you rely on
handledByBranch to return
YES for every incoming Branch-generated Universal Link, you can inform the Branch SDK by following these steps:
- In your Info.plist file, create a new key called
- Add your custom domain(s) as a string.
- Save the file.
Multiple custom domains
If you have an unusual situation with multiple custom link domains, you may also configure
branch_universal_link_domains as an array of strings.
Configure your ESP¶
Setup a Sender Authentication Package¶
Configure the Sender Authentication Package for your Salesforce Marketing Cloud account using instructions from your Salesforce account manager.
For more information on how to set up your domain, please visit Salesforce Marketing Cloud's documentation.
Updating DNS settings
As soon as you've configured and verified the Sender Authentication Package with the Salesforce team, please find the click record in your DNS settings so we can update your DNS settings.
- Next, confirm your Salesforce Data Domain from your Salesforce account manager. You will need this later when you enable the integration in Branch.
Set up your click tracking domain¶
After you added and verified a click tracking domain you have to update DNS CNAME for it and point it to
thirdparty.bnc.lt. Once the CNAME record is added, please allow up to an hour for Branch to generate SSL and AASA files for your click tracking domain.
Please be aware that it may take up to an hour to resolve SSL errors once you change the CNAME. During this time, link redirects on the click tracking domain will redirect to
branch.io. If you are making this change to a live domain that has email click traffic from your users, it’s best to schedule time with your Branch account manager to expedite the changes during a time of low click traffic.
Using Universal email¶
Once you’ve completed the one time setup steps, it’s time to send your first email.
This guide will identify which web links you'd like to open the app and deep link, as well as convert them to Branch links.
Flag your deep links¶
For the email links that you would like to deep link to content, add mc-deep-link="false" to HTML and $deep_link=true to the URL as a query parameter, for example:
<a mc-deep-link="false" href="links.example.com?$deep_link=true" >Link to your app!</a>
This will ensure that your links are converted to Branch links that will open the app on iOS and Android, with full tracking and attribution.
Curious about how email works and more FAQ? Visit our Universal Email Overview page.