> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/platform-features/tracking/mobile-app-tracking/configure-deep-linking-logic-with-uri-schemes.md).

# 使用 URI 方案配置深度链接逻辑

某些带有自定义应用内浏览器的移动应用不支持所有深度链接技术，因此在标准深度链接失效时，需要使用 [URI 方案](https://en.wikipedia.org/wiki/List_of_URI_schemes) 来确保跟踪一致。请按照本文中的步骤操作，以提高用户通过这些自定义应用内浏览器访问销售落地页时的转化跟踪准确性。

#### 预期结果流程图

下方流程图展示了您希望实现的结果。简而言之，您需要在 impact.com 上配置重定向规则，尽可能将点击跟踪链接的用户引导至相应的移动应用页面。如果用户的设备上未安装该应用，无法跳转到应用页面，则应将他们引导至该页面的网页版。您还可以在 impact.com 上配置插页式落地页，以确保用户只会被重定向至应用认可的目标页面。

<div data-with-frame="true"><figure><img src="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-fed65268965e8e1db8473062d52095b14b220e3d%2F260dbc4571ab3a646158dccf6f817e64888da69f1fe481f7a4d9c2f90fe73003.png?alt=media" alt="" width="296"><figcaption></figcaption></figure></div>

#### 前提条件

* 移动应用的 URI 方案，例如 **`acmeapp://`**`item/view/12345`，在应用的 Android 和 iOS 版本中必须保持一致。
* 必须将网页 URL 路径映射到移动应用的 URI 方案，重定向才能正常工作。例如，如果 ACME Corporation 的 URL 为 `https://acme.com/item/view/12345`，其 URI 应为 `acmeapp://item/view/12345`.
* 您必须了解移动应用中不受支持的路径（即未映射的路径），以便在规则条件中为插页式页面设置相应的筛选条件，具体如下所述。

#### 配置 URI 方案跟踪

{% stepper %}
{% step %}
**步骤 1：在应用中配置 URI 方案跟踪**

配置移动应用，以便在引荐来源为 URI 方案时进行跟踪。

1. 解析 URI 方案中的 `clickid` 以及其他相关的网关跟踪参数。
2. 调用 PageLoad API，在应用打开事件中将该 URI 传递给 PageUrl 字段。

   * 如需了解详情，请参阅 [创建页面加载](https://integrations.impact.com/brand-api-reference/reference/page-load/page-load) API 参考。

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>示例：</strong> <code>acmeapp://item/view/12345?clickid=abcdef12345</code>.</p></div>

{% endstep %}

{% step %}
**步骤 2：配置程序的 URI 方案**

1. 在顶部导航栏中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2F210dEQa93qyQgoJDkieL%2FUser%20profile.svg?alt=media\&token=f84c5b17-fae4-4a30-990a-9de5e57a150b) **\[用户个人资料] → 设置**.
2. 在右侧栏的 *跟踪*下，选择 **常规**.
3. 在 URI 方案字段中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-a600f51d86cbf3c02c36ea5cf311867b2bb4cf89%2F00a06da7505c774dc36762a66bcd169b1d62cb35af729e3383729755194758fb.svg?alt=media) **\[编辑]**.
4. 输入移动应用的 **URI 方案**，并删除方案末尾的 `://` 。
   * 如果列出了多个 URI 方案，impact.com 将默认使用第一个方案。
5. 选择 **保存**.
   {% endstep %}

{% step %}
**步骤 3：创建重定向规则**

1. 在顶部导航栏中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2F210dEQa93qyQgoJDkieL%2FUser%20profile.svg?alt=media\&token=f84c5b17-fae4-4a30-990a-9de5e57a150b) **\[用户个人资料] → 设置**.
2. 在右侧栏的 *技术*下，选择 **拦截与重定向**.
3. 在右上角，选择 **配置规则**.
4. **为规则** 起一个能清晰描述其用途的名称。
   * 名称应体现规则的用途。
5. 添加一个 *条件* 使用 **应用名称** 参数，并输入此规则适用的移动应用平台。
   * impact.com 建议添加 *Facebook*, *Instagram*和 *X*.
6. 你也可以 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6282f271b7521383385339243690b303086736d9%2F3b5a585dd2895bdf1c30d1236c72ba590dddd18717863b27074c8d313d05ae20.svg?alt=media) **\[添加另一个]** 条件，并使用 **落地页** 参数，指定要将用户重定向到的路径和域名。

   * 建议执行此步骤，这样你就可以仅对应用能够识别的路径使用此功能。
   * 使用 [正则表达式](https://en.wikipedia.org/wiki/Regular_expression) 匹配包含特定路径的落地页，请参见以下示例。

   ```programlisting
   ^(https?:\/\/)?(www\.)?(domain\.com|sub\.domain\.com)(\/(shop|product)(\/[^?]*?)?)?(\/?(\?.*)?)?$
   ```
7. 你也可以 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6282f271b7521383385339243690b303086736d9%2F3b5a585dd2895bdf1c30d1236c72ba590dddd18717863b27074c8d313d05ae20.svg?alt=media) **\[添加另一个]** 条件，并使用 **概率** 参数，指定用于 A/B 测试的流量转向百分比。

   <div data-with-frame="true"><figure><img src="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FxXIQNl4H15BdQNWJdkKC%2FScreenshot%202026-05-25%20at%2011.01.54.png?alt=media&amp;token=9823e26d-1b50-4022-a1c5-24831e9b0abc" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}
**第 4 步：自定义移动深度链接的插页**

1. 在 *操作* 字段中，使用 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-c2cb550b55c51ea1eeff0acbd6f437a03b621a2c%2F60d033ae8a04c14498d5229c3c0160ac05feea7f605dbd770741793c900469f0.svg?alt=media) **\[下拉菜单]** 选择 **移动深度链接**.
2. 自定义插页模板，使其符合你的品牌形象：

| 字段            | 说明                                                                                                                      |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- |
| 标题文本和字体颜色     | 标题文本是在插页上以大号字体显示的简短语句。你可以指定文本内容，并使用颜色选择器或 [十六进制](https://en.wikipedia.org/wiki/Hexadecimal) 表示法定义字体颜色。                  |
| 副标题文本和字体颜色    | 副标题文本是在插页上标题下方显示的简短语句。你可以指定文本内容，并使用颜色选择器或 [十六进制](https://en.wikipedia.org/wiki/Hexadecimal) 表示法定义字体颜色。                  |
| 上传徽标          | 上传 .gif、.jpg、.png 或 .svg 格式的品牌徽标。图片大小不得超过 1 MB。                                                                         |
| 上传封面图片        | 上传合适的背景图片，格式可以是 .gif、.jpg、.png 或 .svg。图片大小不得超过 1 MB。                                                                    |
| “打开应用”按钮标签和颜色 | 按钮标签是显示在按钮上的文本，点击该按钮即可打开指向移动应用的 URI 方案。你可以指定文本内容，并使用颜色选择器或 [十六进制](https://en.wikipedia.org/wiki/Hexadecimal) 表示法定义字体颜色。 |
| 继续链接标签和字体颜色   | 链接标签是显示在链接上的文本，点击该链接即可打开目标网页 URL。你可以指定文本内容，并使用颜色选择器或 [十六进制](https://en.wikipedia.org/wiki/Hexadecimal) 表示法。             |

<div data-with-frame="true"><figure><img src="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-05ea3ea50f8f93b549691e27fe0bc882cd02a9c9%2Fbdbeb71e1227b728b8a97a7b0fa9083cd676a5ab73dd505b312ee1a60c80f751.png?alt=media" alt="" width="373"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**第 5 步：配置应用打开逻辑和自动重定向**

1. 在 *操作* 字段中，滚动到视觉自定义选项的末尾，并填写以下字段。

   | 字段            | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | 应用打开          | <p>指定何时打开您的移动应用：</p><p>• <strong>插页加载后立即打开</strong> <mark style="color:$success;">\[推荐]</mark> — 插页加载后，立即在用户的设备上自动打开您的移动应用。</p><p>• <strong>点击按钮时打开</strong> — 插页加载后，要求用户在其设备上确认打开您的移动应用。</p>                                                                                                                                                                                                                                                                                                                                           |
   | 自动重定向         | 选中 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-b5e1740618ed6571d97b8fed7c25a7678f85d375%2F299632fb6f4f91fbf9847471754cc6180e4284a65b4960af4c4ea472a159f552.svg?alt=media) **\[未选中的复选框]** ，以便在应用无法打开时设置超时时间；超时后，系统会自动将用户重定向到网页链接。impact.com 建议将超时设置为 **10**秒。                                                                                                                                                                                   |
   | 默认 URI 路径     | 输入一个 URI 路径，例如您网站主页的路径；当系统无法从 URL 中提取路径时，将使用此路径。这样，即使用户通过原本无法打开您应用的自定义应用内浏览器访问，也能确保应用成功打开。例如，如果您的目标页面 URL 是 `https://acme.com`，而您输入的默认 URI 路径是 `home`，生成的 URI scheme 链接将是 `acmeapp://home`.                                                                                                                                                                                                                                                                                                                                             |
   | 自定义 URI 正则表达式 | <p>默认情况下，impact.com 会将目标落地页 URL 中的路径附加到 URI scheme，生成 URI scheme 链接。例如，如果您的目标页面 URL 是 <code><https://acme.com/product/12345></code>，而您的 URI scheme 是 <code>acmeapp</code>，生成的 URI scheme 将是 <code>acmeapp\://product/12345</code>.</p><p>不过，您也可以使用 <a href="https://en.wikipedia.org/wiki/Regular_expression">正则表达式</a> 指定要从目标页面 URL 中提取并附加到 URI scheme 的部分。例如，如果您的目标页面 URL 是 <code><https://acme.com/product/12345></code>，而您输入的正则表达式是 <code>acme.com.\*$</code>，生成的 URI scheme 将是 <code>acmeapp\://acme.com/product/12345</code>.</p> |
2. 完成后，请记得 **保存** 您的规则。
   {% endstep %}
   {% endstepper %}

#### 在回传中使用插页

如果您使用 [回传](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/account-administration/account-settings/notifications/enable-event-notification-postbacks-for-brands.md) 来跟踪 impact.com 各类计划中的转化，impact.com 建议仅在您的主计划中实施插页。主计划负责目标页面之前的最后一次重定向，确保在打开移动应用之前跟踪所有点击。当转化回传到某个子计划时，这种做法可确保归因准确无误。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/platform-features/tracking/mobile-app-tracking/configure-deep-linking-logic-with-uri-schemes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
