安装
Remix
在 Remix 应用中安装 Talivia。
使用根文档,让每个路由都包含追踪器。
请从“设置 → 追踪”复制完整的代码片段。 以下示例重点说明代码在各框架中的放置位置。请在安装的代码片段中保留自动生成的属性,例如
data-domain 。有关所有选项,请参阅 追踪器配置 ;如果同一访客会在不同子域名之间移动,请参阅 子域名追踪 。添加脚本
打开 app/root.tsx,将代码片段放在 Remix 的 Scripts 组件之前。
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react';
export default function App() {
return (
<html lang="en">
<head>
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<script defer src="https://talivia.com/script.js" data-website-id="YOUR_WEBSITE_ID" />
<Scripts />
</body>
</html>
);
}请替换网站编号。从 Talivia 的“设置 → 数据追踪”复制编号。
打开一个路由,并确认 Talivia 收到了会话。