diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index ce9c91857..bf64e20b9 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -15,31 +15,9 @@ import MarketMetadataProvider from '@context/MarketMetadata' import { WagmiConfig } from 'wagmi' import { ConnectKitProvider } from 'connectkit' import { connectKitTheme, wagmiClient } from '@utils/wallet' -import posthog from 'posthog-js' -import { PostHogProvider } from 'posthog-js/react' -import { useRouter } from 'next/router' - -// Check that PostHog is client-side (used to handle Next.js SSR) -if (typeof window !== 'undefined') { - posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, { - api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://eu.posthog.com', - persistence: 'memory' - }) -} function MyApp({ Component, pageProps }: AppProps): ReactElement { Decimal.set({ rounding: 1 }) - const router = useRouter() - - useEffect(() => { - // Track page views - const handleRouteChange = () => posthog?.capture('$pageview') - router.events.on('routeChangeComplete', handleRouteChange) - - return () => { - router.events.off('routeChangeComplete', handleRouteChange) - } - }, [router.events]) return ( <> @@ -55,11 +33,9 @@ function MyApp({ Component, pageProps }: AppProps): ReactElement { - - - - - + + +