From a379affda25f498b89f8023d12ac4e89a6c252ac Mon Sep 17 00:00:00 2001 From: wil Date: Tue, 29 Oct 2024 15:08:03 -0400 Subject: [PATCH] updating posthog script --- src/app/index.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/app/index.tsx b/src/app/index.tsx index 50e901f099..1197366470 100644 --- a/src/app/index.tsx +++ b/src/app/index.tsx @@ -9,20 +9,23 @@ import { PostHogProvider } from "posthog-js/react"; import "./global.css"; import { useRenderCounter } from "~/hooks/useRenderCounter"; -// function PostHogInit() { -// const apiKey = "phc_jBFgac0mVALAFk3negnSfYCcHgvkT00yBLQDmCDYNBb"; -// posthog.init(apiKey, { -// api_host: "https://us.i.posthog.com/", -// ui_host: "https://us.i.posthog.com/", -// }); -// } +function PostHogInit() { + const apiKey = "phc_jBFgac0mVALAFk3negnSfYCcHgvkT00yBLQDmCDYNBb"; + posthog.init(apiKey, { + api_host: "https://us.i.posthog.com/", + ui_host: "https://us.i.posthog.com/", + }); +} const App = () => { const useStrictMode = false; useRenderCounter("App"); - // useEffect(() => { - // PostHogInit(); - // }, []); + useEffect(() => { + if (import.meta.env.DEV) { + return; + } + PostHogInit(); + }, []); if (useStrictMode) { return (