> 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 跟踪**

配置您的移动应用，以便在 referrer 为 URI scheme 时进行跟踪。

1. 解析 `clickid` ，它来自 URI scheme 以及其他相关的网关跟踪参数。
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**，不包括 `://` 中的末尾部分。
   * 如果列出多个 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) **\[下拉菜单]** 选择 **移动深度链接**.
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) 来跟踪不同 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
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=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
