Salesforce - Open App Default
概述
了解 Email Studio。通过全球排名第一的电子邮件营销平台吸引您的客户。构建更智能的电子邮件—从基本的营销 campaign 到复杂的一对一消息。
1. 完成 Universal Email 先决条件
可能需要开发者
以下 Universal Email 先决条件包括提供 URI scheme 和其他可能需要开发人员的部分:
需要开发人员
以下 Universal Email 先决条件涉及应用代码更改:
2. 配置 Salesforce
保护您的Salesforce点击跟踪域
If your click tracking domain is not secure (i.e., secure domains will start with https://
), you will need to purchase an SSL SKU from your Salesforce Account Manager.
注意:请记住,Salesforce 可能需要4-6周来处理 SSL 证书请求。
在 Salesforce Marketing Cloud 中配置您的 AASA 文件
您的 Salesforce 帐户必须进行配置以正确处理 Universal Link。在 Email Studio 的 Send Management 部分下深度链接中配置设置。请确保您使用的帐户与正确的点击追踪域相对应。
- 输入 AppID 值
- Check the "Exclude Profile" and "Unsub Center" checkboxes to force links to these items to open in the browser and not the app, if desired.
- Click "Save" to save the configuration.
- 让 Salesforce 和 Branch 知道您已经完成了这一步,并您的技术客户经理确认一切正常。
3. 启用集成
要启用集成,您需要:
- 在左侧导航中,点击电子邮件 。
- 在电子邮件概述页面上,点击顶部的 Manager 选项卡。
- 找到您的 ESP,然后点击启用 。

Branch 会自动检测您在上述 Branch 帐户的初始设置过程中已经提供的所有全局链接设置。
If you have not set up your global link settings and redirect preferences, you will be prompted to do so at this time.
4. 提供点击追踪域
通过点击追踪域,您可以追踪打开电子邮件和点击链接的参与度。
如果您不确定点击追踪域(CTD)是什么,请查看一封你最近发送的电子邮件。如果将鼠标悬停在链接上或右键点击/复制链接地址,您将看到电子邮件中链接域与 HTML 中的 URL 不匹配。此域是您的 ESP 所使用的点击追踪域,为您提供点击报告。
Salesforce v1 Open App Default 集成要求您提供以下内容:
- 点击追踪域—通过 Salesforce 用于电子邮件链接的域
Remove
http://
orhttps://
when adding your click tracking domain in the Branch dashboard

请记住
- 您可以根据需要启用与多个 CTD 的集成,但是不能将同一 CTD 添加到多个 Branch 操作后台 (Dashboard) 或 ESP 集成中。
在点击下一步并继续进行验证与测试部分之前,请完成通过集成验证所需的以下部分。
5. 验证集成
生成 SSL 证书和 AASA 文件(仅 iOS)之后,您可以继续查看验证测试,修复所有问题,然后测试集成。
Branch 自动验证以下内容:
- 集成了 iOS SDK(必需)
- 集成了 Android SDK(必需)
- 深度链接已设置(必需)
- 点击追踪域已设置(必需)
- AASA 文件有效(必需)
- 已正确设置 SSL(必需)
- CNAME 指向 thirdparty.bnc.lt(视情况而定)
- 已设置 Universal Linking(必需)
- 托管的深度链接数据(可选)
- 正在追踪应用事件(可选)
- Android App Link(可选)

常见验证问题
CNAME 不指向 Branch
由于此集成要求 CNAME 指向 Salesforce,因此您总是会收到此错误。您可以放心地忽略。
无法正确设置 SSL
如果您在 SSL 证书验证方面遇到问题,那么原因通常是您的点击追踪域已经设置了 SSL,并且存在一些限制,使第三方无法代表您提交证书签名请求。
AASA 文件无效
幸运的是,最容易解决的错误恰恰是该错误的主要原因,它的问题取决于正确设置 SSL。通过解决 SSL 错误,AASA 文件错误应同时解决。
6. 测试集成
验证过程完成后,您可以通过生成测试链接来测试集成。 Branch 生成的测试链接是唯一的,因为它已经被转化为 Branch Link,并允许您进行测试而无需在 ESP 中创建电子邮件模板。实际上,一旦用户点击您的常规电子邮件模板链接,此转化就会在幕后进行。
要生成测试链接,您需要:
- 在验证和测试部分中,输入您的网站上的 URL。
- 点击获取测试链接 。
- 生成测试链接后,您可以通过以下方式分享它:
- 复制到剪贴板
- 短信
- 邮箱

生成测试链接后,请点击移动设备上的链接;不要忘记确认您的移动设备已经安装了该应用!
7. 生成电子邮件的 Branch Link
1. 使用 Salesforce AMPscript 转化链接
通过 Salesforce AMPscript,我们会在 Salesforce 中添加新的内容区,以将您的电子邮件模板中的网页链接转化为 Branch Link。
-
Work with your Branch account manager to modify the following Salesforce AMPscript snippet, replacing
DOMAIN-HERE
with your Branch base domain (i.e., example.app.link):%%[ VAR @deeplink, @branch_base_url SET @branch_base_url = "https://DOMAIN-HERE/3p?%243p=e_et" SET @deeplink = CONCAT(@branch_base_url, CONCAT("&%24original_url=", URLEncode(@link_to_be_wrapped, 1, 1))) ]%%
-
After logging into Salesforce Marketing Cloud, click on Email Studio and then a sub-menu will appear. Click on Email in the dropdown menu:

- This will take you to the landing page for the Email section. Click on Content in the menu bar to navigate to the Content section:

- 在“内容”部分,您将在左侧看到文件夹列表。右键点击 我的内容 文件夹,然后在内容构建器菜单中选择 创建文件夹 :

- Name the folder
Branch
:

- 创建文件夹后,在右上角点击“创建”按钮,然后点击“内容块” ,最后点击“自由格式” :

- 在“自由格式”屏幕上,粘贴先前生成的代码段:

-
点击保存。
-
In the Create Free Form window that appears, enter
deeplink
in the text field named Content Name. Click on Save after you enter the text:

- 现在,您将返回到“内容”部分的文件夹列表,其中列出了文件Deeplink :
您现在已经成功创建了深度链接 AMPscript。
代码片段
The snippet below will follow this format. The code below also has a placeholder for
@branch_base_url
. Replace it with yours.
%%[ VAR @deeplink, @branch_base_url SET @branch_base_url = "BASE URL FROM BRANCH" SET @deeplink = CONCAT(@branch_base_url, CONCAT("&%24original_url=", URLEncode(@link_to_be_wrapped, 1, 1))) ]%%
配置您的 Salesforce 电子邮件模板
本节介绍如何将现有电子邮件模板中的各个链接转化为 Branch 深度链接。您需要对要转化为 Branch 深度链接的电子邮件模板中的所有链接执行此操作。
例如,如果您决定将下面的链接转化为 Branch Link:
<a href="https://branch.io/product/1234/"> I want it! </a>
This is what the link will look like in the email template, after you added the AMPscript to convert it into a Branch link:
%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234/" ContentAreaByName("My Contents\branch\deeplink") ]%%
<a href="%%=RedirectTo(@deeplink)=%%">Example link</a>
使用 AMPscript 将链接转化为 Branch Link 的过程如下(此流程将链接转化为单独的文档,然后将其粘贴回最终模板中):
-
登录到 Salesforce Marketing Cloud
-
Click on Email Studio and then a sub-menu will appear. Click on Email in the dropdown menu:
-
This will take you to the landing page for the Email section. Click on Content in the menu bar to navigate to the Content section:
-
前往包含您的电子邮件的文件夹,然后打开一个现有的电子邮件。确保电子邮件采用 HTML 布局,如下所示:
-
Choose a link that you want to convert to a Branch deep link. Copy the text right after the
href=
in your email template, and paste it into a separate document. In the example, it is:"https://branch.io/product/1234/"
-
添加
%%[ SET @link_to_be_wrapped =
before the link in your separate document. In the example, this is now:%%[ SET @link_to_be_wrapped =
"https://branch.io/product/1234/"
-
添加
ContentAreaByName("My Contents\branch\deeplink"")]%%
after the link:%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234/"
ContentAreaByName("My Contents\branch\deeplink"")]%%
-
From the original link in your template, copy the text from and including
<a
until thehref=
. Add it to the text after%%
in the last step. Please include the<a
but not thehref=
:%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234/" ContentAreaByName("My Contents\branch\deeplink"") ]%%
<a style="_any css can be added here_"
-
添加
href="%%=RedirectTo(@deeplink)=%%"
to the end:%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234/" ContentAreaByName("My Contents\branch\deeplink"") ]%% <a style="_any css can be added here_"
href="%%=RedirectTo(@deeplink)=%%"
-
From the original link in your template, copy the end of the tag, the link text, and the closing tag (
>I want it!</a>
in the example) and add it to the end:%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234/" ContentAreaByName("My Contents\branch\deeplink"") ]%% <a style="_any css can be added here_" href="%%=RedirectTo(@deeplink)=%%"
>I want it!</a>
-
Copy your final result from the separate document back into your email template, replacing everything inside and including the
<a></a>
tags in the template. -
对您要转换化 Branch 深度链接的电子邮件模板中的所有链接重复此操作。
链接转化摘要
Wherever you use
<a>
tags in your email templates, replace those with AMPscript to convert the web URLs into Branch links. The AMPscript references the Content Area setup earlier.%%[SET @link_to_be_wrapped = "ADD YOUR LINK HERE" ContentAreaByName("My Contents\branch\deeplink")]%% <a href="%%=RedirectTo(@deeplink)=%%">Click Me</a>
For example,
Before:
<a href="https://branch.io/product/1234">Example link</a>
之后:
%%[ SET @link_to_be_wrapped = "https://branch.io/product/1234" ContentAreaByName("My Contents\deeplink") ]%%
<a href="%%=RedirectTo(@deeplink)=%%">Example link</a>
内容区域文件夹
Make sure your
deeplink
Content Area is in the right folder. Either change the folder to "My Contents" or change the path used by "ContentAreaByName" in the Branch script.
2. 使常规 Branch Link 与电子邮件兼容
Be sure to add "$3p":"e_et"
to the deep link data of any links you use in email to ensure Universal Link and click tracking works as expected.
3. Create email links via API
To create email links via API, please use the instructions on how to create links via API, but include the following key value pairs in your call:
"$3p":"e_et"
这是 Universal Link 和点击追踪功能所必需的。"$original_url":"{{your web url URI encoded}}"
For each piece of content, include a URI encoded version of your content's web URL. You can also add deep link data as query parameters on that web URL. This ensures accurate Content Analytics reporting.
Example:"$original_url":"https%3A%2F%2Fshop.com%2Fshoes%2Fbrown-shoes%3Fmy_key%3Dmy_value%26campaign%3Dshoe_discounts"
这是链接前后的外观(后者是 Branch 深度链接)。
- 之前: http://example.com/?foo=bar
- 之后: https://vza3.app.link/3p?%243p=e_xx&%24original_url=http%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar
注意这些是简化的示例,不是实际的演示链接。
4. 标记 web-only 链接
For links that should always open in web, even if the app is installed, add Salesforce's link attribute mc-deep-link="false"
to your link tag to ensure the app does not open in iOS:
<a mc-deep-link="false" href="https://my.app.link/3p?$3p=e_et&$original_url=..." > This link will not open the app. </a>
If the link in the "href" part of the tag is a normal web link, the app will NOT open in Android. If the link in the "href" part of the tag is a Branch link, but you don't want the app to open, then you'll need to add &%24web_only%3Dtrue
as a query parameter:
<a href="https://my.app.link/3p?%243p=e_xx&%24original_url=http%3A%2F%2Fexample.com&%24web_only%3Dtrue" > This link will not open the app. </a>