change owner
This commit is contained in:
parent
3afac6ccd2
commit
2498ba21f5
|
@ -1,25 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function HotjarLoader() {
|
||||
useEffect(() => {
|
||||
(function (h, o, t, j, a, r) {
|
||||
h.hj =
|
||||
h.hj ||
|
||||
function () {
|
||||
(h.hj.q = h.hj.q || []).push(arguments);
|
||||
};
|
||||
h._hjSettings = { hjid: 3414362, hjsv: 6 };
|
||||
// 创建 <script> 元素
|
||||
r = o.createElement("script");
|
||||
r.async = 1;
|
||||
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
|
||||
|
||||
// 将 <script> 插入 <head>
|
||||
headElement.appendChild(r); // 使用明确的变量
|
||||
})(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv=");
|
||||
}, []);
|
||||
|
||||
return null; // 组件不需要渲染任何内容
|
||||
}
|
10
app/page.tsx
10
app/page.tsx
|
@ -1,8 +1,16 @@
|
|||
import { Analytics } from "@vercel/analytics/react";
|
||||
import { Home } from "./components/home";
|
||||
import { getServerSideConfig } from "./config/server";
|
||||
import HotjarLoader from "./components/HotjarLoader"; // 引入 HotjarLoader
|
||||
import Hotjar from '@hotjar/browser';
|
||||
const siteId = 3414362;
|
||||
const hotjarVersion = 6;
|
||||
|
||||
Hotjar.init(siteId, hotjarVersion);
|
||||
|
||||
// Initializing with `debug` option:
|
||||
Hotjar.init(siteId, hotjarVersion, {
|
||||
debug: true
|
||||
});
|
||||
const serverConfig = getServerSideConfig();
|
||||
|
||||
export default async function App() {
|
||||
|
|
Loading…
Reference in New Issue