fixing fathom analytics

This commit is contained in:
Travis Fischer
2021-01-19 21:21:33 -05:00
parent dfcb777a12
commit 894c23c02e
3 changed files with 4 additions and 2 deletions

View File

@@ -17,4 +17,4 @@
#FIREBASE_COLLECTION_IMAGES=
# Optional
#FATHOM_ID=
#NEXT_PUBLIC_FATHOM_ID=

View File

@@ -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
? {

View File

@@ -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)