Closed raae closed 11 months ago
Make sure to configure the script so it only tracks visitors to mixpod.app, not localhost, deploy previews etc. I can't find it in the docs anymore, but it used to be by adding data-included-domains="mixpod.app"
<script src="https://cdn.usefathom.com/script.js" data-included-domains="mixpod.app" data-site="ABCDEFG" data-spa="auto" defer></script>
The PR #11 does not pull in the env variable; it prints the env variable name as a string ie. no analytics are logged, so I am reponing this issue.
Looks like you need to use import.meta.env.PUBLIC_FATHOM_EMBED
per docs https://docs.astro.build/en/guides/environment-variables/ and to get it to print the value and not the string import.meta.env.PUBLIC_FATHOM_EMBED
you'll need to use JSX. Probably data-site={import.meta.env.PUBLIC_FATHOM_EMBED}
.
If you like, you can do this in the frontmatter:
const PUBLIC_FATHOM_EMBED = import.meta.env.PUBLIC_FATHOM_EMBED;
Then you'll can do the head:
data-site={PUBLIC_FATHOM_EMBED}
.
usefathom
https://usefathom.com/docs/start/install
https://usefathom.com/docs/script/embed