# Expo (https://talivia.com/zh-CN/docs/installation-guides/expo)



Talivia 的浏览器追踪器适用于网页。本指南适用于 Expo Web 或 Expo Router 应用的网页构建。




## Expo Router [#expo-router]

创建或更新 `app/+html.tsx`，并将脚本放入 body。

```tsx
import { ScrollViewStyleReset } from 'expo-router/html';

export default function Root({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <head>
        <ScrollViewStyleReset />
      </head>
      <body>
        {children}
        <script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID" />
      </body>
    </html>
  );
}
```

## Expo 网页版 HTML [#expo-网页版-html]

如果项目提供网页 HTML 模板，请在 `</body>` 之前添加通用代码片段。

```html
<script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID"></script>
```

原生应用需要采用其他方式。此脚本只追踪浏览器流量，可用于 Expo Web，但不能追踪 iOS 或 Android 原生界面。
