> 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 scheme](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 scheme，例如 **`acmeapp://`**`item/view/12345`，必须在你的应用的 Android 和 iOS 版本中保持一致。
* 为了使重定向生效，你的网页 URL 路径必须映射到移动应用的 URI scheme，例如，如果 ACME Corporation 的 URL 是 `https://acme.com/item/view/12345`那么其 URI 将是 `acmeapp://item/view/12345`.
* 你必须了解移动应用中任何不受支持的路径（即未映射的路径），以便你能够在规则条件中针对中间页实施相应的筛选器，详见下文。

#### 配置 URI scheme 跟踪

{% stepper %}
{% step %}
**步骤 1：在你的应用中配置 URI scheme 跟踪**

配置你的移动应用，以便在引用来源为 URI scheme 时进行跟踪。

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

   * 请参见 [创建 Page Load](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 scheme**

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 Scheme 字段中，选择 ![](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 scheme**，不包括 `://` 从 scheme 的末尾移除。
   * 如果列出了多个 URI scheme，impact.com 将默认使用第一个 scheme。
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：为 Mobile Deep Linking 自定义中间页**

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) **\[下拉菜单]** 以选择 **Mobile Deep Linking**.
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 scheme 的按钮上显示的文本。你可以指定此文本的内容，并使用颜色选择器或 [十六进制](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 %}

#### 将中间页与 postback 结合使用

如果你使用 [postback](/brand/zh/what-would-you-like-to-learn-about/account-administration/account-settings/notifications/enable-event-notification-postbacks-for-brands.md) 如果你使用 postback 来跟踪不同 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.
