> 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/set-up-tracking/troubleshooting-universal-links-in-app-to-app-tracking.md).

# 排查应用间跟踪中的 Universal Links 问题

<a href="https://pxa.impact.com/student/activity/1117597?sid=0c0e3e5c-54c9-4435-9bee-ebcdccb7f292&#x26;sid_i=0?utm_source=app.impact.com&#x26;utm_medium=owned-platform&#x26;utm_content=tra-350&#x26;utm_campaign=help-center" class="button primary">参加 PXA 课程</a>

通用链接在操作系统（OS）级别进行验证，并且需要由用户发起的操作，例如点击网页链接，才能打开移动应用。

#### 排查通用链接问题

{% stepper %}
{% step %}

#### **验证来自合作伙伴应用的点击是否为用户发起的点击**

假设该链接不是普通的锚点标签，而是实例化了一个新的 **WebView** （请参见本页底部的说明）。在这种情况下，这不算作用户发起的导航，因此 OS 不会打开通用链接。这是最常见的情况。要解决此问题，您需要考虑在 WebView（WKWebView、UIWebView 或 SFSafariViewController）中使用普通的锚点链接，以便通用链接启动应用。

其他非用户实例化点击的例子包括：直接将 URL 复制粘贴到搜索栏中，或在 JavaScript 中使用 `onload()` 或 `click()`.
{% endstep %}

{% step %}

#### **检查您发送用户到的页面是否支持通用链接**

在某些情况下，impact.com 依赖于在后续重定向中配置通用链接，通常是广告主域名。

* 例如，impact.com 的跟踪域名（`goto.advertiser.com`）会重定向到 `advertiser.com`。通用链接配置在 `advertiser.com` 域名上。因此，务必要验证您发送用户前往的页面是否已启用通用链接。您可以通过检查位于广告主域名上的 Apple 关联文件来完成此操作。
* 在我们的示例中， `http://advertiser.com/.well-known/apple-app-site-association`，您会注意到 impact.com 跟踪域名的关联文件默认包含所有子目录。

{% hint style="info" %}
**注意：** 尽管在使用 JavaScript 重定向时通用链接不起作用，但 HTTP 3xx 重定向仍会保留对原始用户事件的引用。impact.com 在跟踪中使用 HTTP 3xx 重定向，因此，在满足其他条件时，点击跟踪域名后跳转的链接会成功启动广告主应用。
{% endhint %}

例如，下面的关联文件将允许以下通用链接： `advertiser.com/item/123` 但不会允许以下链接： `advertiser.com` 或 `advertiser.com/section/furniture`.

```programlisting
{
   "applinks":{
      "apps":[
      ],
      "details":[
         {
            "appID":"A1AAA22BBB.com.advertiser.Advertiser",
            "paths":[
               "NOT /section/*",
               "/item/*"
            ]
         }
      ]
   }
} 
```

{% endstep %}

{% step %}

#### **请确认打开的初始 WebView 也支持通过通用链接进行重定向**

某些 WebView 可能会阻止通用链接，这会导致跟踪链接在 WebView 内部打开，而不是打开广告主应用。虽然不常见，但当 WebView 导航策略设置为 WKNavigationActionPolicyAllow + 2 时，就可能发生这种情况。这会导致 WebView 导航到该链接，而不会尝试使用通用链接。
{% endstep %}

{% step %}

#### **查看社交媒体政策**

一些社交媒体应用（如 Facebook）会阻止通用链接。如果是这种情况，使用 **移动应用中间页** 可能会有所帮助，我们建议联系您的 CSM 寻求帮助（或 [联系支持](https://app.impact.com/support/portal.ihtml?createTicket=true)）。impact.com 正在积极开发改进来自社交媒体应用的深度链接和归因的方法。
{% endstep %}
{% endstepper %}

#### Apple 的进一步说明

如果您实例化一个 [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) , [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview) ，或 [UIWebView](https://developer.apple.com/documentation/uikit/uiwebview) 对象来处理通用链接，iOS 会在 Safari 中打开您的网站，而不是打开您的应用。但是，如果用户在嵌入式的 SFSafariViewController、WKWebView 或 UIWebView 对象内点击通用链接，iOS 会打开您的应用。

有关更多信息，请参阅 Apple 的 [支持通用链接](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html) 帮助文章。


---

# 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/set-up-tracking/troubleshooting-universal-links-in-app-to-app-tracking.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.
