diff --git a/.env.example b/.env.example index a1a59f8..28903d4 100644 --- a/.env.example +++ b/.env.example @@ -17,4 +17,4 @@ #FIREBASE_COLLECTION_IMAGES= # Optional -#FATHOM_ID= \ No newline at end of file +#NEXT_PUBLIC_FATHOM_ID= \ No newline at end of file diff --git a/lib/config.ts b/lib/config.ts index 73c422e..28b2290 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -80,7 +80,7 @@ export const api = { // ---------------------------------------------------------------------------- -export const fathomId = isDev ? null : getEnv('FATHOM_ID', null) +export const fathomId = isDev ? null : getEnv('NEXT_PUBLIC_FATHOM_ID', null) export const fathomConfig = fathomId ? { diff --git a/pages/_app.tsx b/pages/_app.tsx index 45ed2e4..468e604 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -31,6 +31,8 @@ export default function App({ Component, pageProps }) { const router = useRouter() React.useEffect(() => { + console.log('loading fathom', { fathomId, fathomConfig }) + if (fathomId) { Fathom.load(fathomId, fathomConfig)