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

# Script 标签

> 在页面 head 中加一行。适用于任何网站。

无论网站用什么技术构建，script 标签都适用。在每个页面的 `<head>` 中加入一行：

```html theme={null}
<script
  async
  src="https://cdn.festtide.com/r/v1/loader.js"
  integrity="sha384-…"
  crossorigin="anonymous"
  data-site="site_…"
  data-consent="auto"
></script>
```

请从[控制台](https://app.festtide.com)（**网站 → 您的网站 → 安装**）复制准确的代码行：其中包含您网站的
真实 ID 和当前运行时的 `integrity` 哈希。上面的代码行使用的是占位值。

## 属性

| 属性 | 必填 | 取值 |
| - | - | - |
| `async` | 是 | 加载时不阻塞页面。 |
| `integrity`、`crossorigin` | 是 | 子资源完整性（Subresource Integrity）：文件若被以任何方式修改，浏览器会拒绝加载。 |
| `data-site` | 是 | 您的网站 ID，`site_…`。 |
| `data-consent` | 否 | `auto`（默认）、`wait` 或 `off`。参见[同意](https://docs.festtide.com/zh/consent.md)。 |
| `data-platform` | 否 | `script`（默认）、`wordpress`、`shopify`、`nextjs`、`expo`（用于即将推出的应用 SDK）。由插件设置，请勿填写。 |
| `data-adapter` | 否 | 运行时如何适配您的主题：`auto`（默认，自动检测）、`css-vars`、`wp-block-theme`、`elementor`、`astra`、`kadence`、`generatepress`、`shopify-dawn`、`none`。 |

## 它会做什么，绝不会做什么

* **绝不阻塞渲染。** 脚本是 `async` 的，您的页面会先完成绘制。
* **失败时保持原样。** 如果时间线延迟、无效或被拦截，您的页面就和没有 Festtide 时一样。最后一份有效的时间线
  会被保留，因此短暂中断不会带来任何可见变化。
* **1.5 秒后放弃。** 网络再慢，也不会让横幅迟迟突然出现。
* **不碰结账流程。** 以 `/checkout`、`/cart`、`/my-account` 和 `/wp-admin` 开头的路径默认被排除。可在工作室
  中为每个活动添加更多排除项。
* **只从一个来源加载。** 运行时、特效和图片都来自 `cdn.festtide.com`，所有文字都以纯文本插入，绝不作为代码
  执行。

## 内容安全策略（CSP）

如果您的网站发送 Content Security Policy，请在 `script-src`、`connect-src` 和 `img-src` 中允许
`cdn.festtide.com`。

## 检查安装

在浏览器中打开您网站的任意页面，然后在控制台查看**网站**：安装状态会变绿，并显示最近一次检测到运行时的时间。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.