> ## Documentation Index
> Fetch the complete documentation index at: https://www.mintlify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Transcend

> 将 Transcend 同意管理与你的 Mintlify 文档集成，使用你现有的 Transcend bundle 在获得访客同意后再加载分析。

使用 [Transcend](https://transcend.io/) 管理文档站点上的 Cookie 同意。当你配置 Transcend 后，Mintlify 会加载你的 Transcend bundle，展示 Transcend 的同意横幅，并仅在访客授予 Analytics 用途的同意后才加载分析和反馈脚本。

如果你已经将 Transcend 作为同意管理平台 (CMP)，并希望在你的产品和文档之间提供一致的同意体验，可以配置 Transcend。

<Note>
  当配置了 Transcend 后，同意横幅由 Transcend 负责展示。Mintlify 内置的同意横幅将不会出现，因此访客只会看到一个提示。
</Note>

<div id="setup">
  ## 设置
</div>

<Steps>
  <Step title="获取你的 Transcend bundle ID">
    在你的 Transcend 控制台中，前往 **Consent Management**，复制你希望用于文档的部署对应的 bundle ID。bundle ID 会出现在你的 Airgap 脚本 URL 中：`https://transcend-cdn.com/cm/<bundleId>/airgap.js`。
  </Step>

  <Step title="将 Transcend 添加到你的 docs.json">
    在 `docs.json` 的 `integrations` 下添加一个 `transcend` 对象：

    ```json theme={null}
    "integrations": {
      "transcend": {
        "bundleId": "YOUR_BUNDLE_ID"
      }
    }
    ```

    你也可以在控制台中通过 **Analytics** → **Add integration** → **Compliance** 配置 Transcend。
  </Step>

  <Step title="验证横幅是否加载">
    部署你的文档并打开站点。Transcend 的同意横幅应在首次访问时出现。接受、拒绝并撤销分析同意，以确认分析脚本会遵循访客的选择。
  </Step>
</Steps>

<div id="configuration">
  ## 配置
</div>

| 字段                 | 类型     | 是否必填 | 说明                                                                        |
| ------------------ | ------ | ---- | ------------------------------------------------------------------------- |
| `bundleId`         | string | 是    | 你的 Transcend bundle ID。只能包含字母、数字、连字符和下划线。                                 |
| `analyticsPurpose` | string | 否    | 用于控制分析和反馈的 Transcend 用途名称。默认为 `Analytics`。如果你在 Transcend 中重命名了该用途，请设置此字段。 |

<div id="custom-analytics-purpose">
  ### 自定义 analytics 用途
</div>

如果你在 Transcend 实例中重命名了 Analytics 用途，请传入精确的用途名称，以便 Mintlify 等待正确用途的同意：

```json theme={null}
"integrations": {
  "transcend": {
    "bundleId": "YOUR_BUNDLE_ID",
    "analyticsPurpose": "Product Analytics"
  }
}
```

<div id="how-consent-gating-works">
  ## 同意控制的工作原理
</div>

* 在 Transcend 解析访客对已配置用途的同意结果之前，分析和反馈脚本不会加载。
* 如果访客先授予同意，之后又撤销同意，页面会重新加载，以便卸载已加载的分析脚本。
* 如果 Transcend 加载失败，或访客始终未处理横幅，分析将保持关闭状态。


## Related topics

- [隐私集成](/docs/zh/integrations/privacy/overview.md)
