diff --git a/apps/web/app/components/posthog-provider.tsx b/apps/web/app/components/posthog-provider.tsx index 7bf47f97465..582d79ba7cb 100644 --- a/apps/web/app/components/posthog-provider.tsx +++ b/apps/web/app/components/posthog-provider.tsx @@ -10,15 +10,11 @@ const POSTHOG_HOST = "https://us.i.posthog.com"; let initialized = false; -function initPostHog(anonymousId: string) { +function initPostHog() { if (initialized || !POSTHOG_KEY || typeof window === "undefined") return; posthog.init(POSTHOG_KEY, { api_host: POSTHOG_HOST, - bootstrap: { - distinctID: anonymousId, - isIdentifiedID: false, - }, capture_pageview: false, capture_pageleave: true, persistence: "memory", @@ -43,15 +39,13 @@ function PageviewTracker() { } export function PostHogProvider({ - anonymousId, children, }: { - anonymousId: string; children: React.ReactNode; }) { useEffect(() => { - initPostHog(anonymousId); - }, [anonymousId]); + initPostHog(); + }, []); if (!POSTHOG_KEY) return <>{children}>; diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index c077d1f4510..13edae493b3 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,6 +1,5 @@ import type { Metadata, Viewport } from "next"; import { Suspense } from "react"; -import { getAnonymousId } from "@/lib/telemetry"; import { PostHogProvider } from "./components/posthog-provider"; import "./globals.css"; @@ -43,7 +42,7 @@ export default function RootLayout({