diff --git a/src/app/StartHotjar.tsx b/src/app/StartHotjar.tsx index 15b162a..7d45b65 100644 --- a/src/app/StartHotjar.tsx +++ b/src/app/StartHotjar.tsx @@ -1,14 +1,17 @@ "use client"; import Hotjar from "@hotjar/browser"; +import { useEffect } from "react"; const siteId: `${number}` | undefined = process.env .NEXT_PUBLIC_HOTJAR_SITE_ID as `${number}` | undefined; const hotjarVersion = 6; -if (siteId) { - Hotjar.init(Number(siteId), hotjarVersion); -} - export function StartHotjar() { + useEffect(() => { + if (siteId) { + Hotjar.init(Number(siteId), hotjarVersion); + } + }); + return null; }