> 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).

# 排查应用到应用跟踪中的通用链接问题

<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** （请参阅本页底部的说明）。在这种情况下，该操作不被视为用户发起的导航，因此操作系统不会打开通用链接。这是最常见的情况。要解决此问题，可以考虑在 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 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/set-up-tracking/troubleshooting-universal-links-in-app-to-app-tracking.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.
