diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 7af15cef2..41a180a19 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -35,7 +35,7 @@ const MyApp: NextPage = ({ Component, pageProps }) => { React.useEffect(() => { if (process.env.NEXT_PUBLIC_ENABLE_ANALYTICS) { // calling inject directly to avoid having this run for self-hosted instances - inject(); + inject({ debug: false }); } }, []); @@ -49,7 +49,10 @@ const MyApp: NextPage = ({ Component, pageProps }) => { customDomain={process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN} trackOutboundLinks={true} selfHosted={true} - enabled={!!process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN} + enabled={ + typeof window !== undefined && + !!process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN + } >