Discourse analytics
Fathom works well with Discourse (a popular message board platform). In order for it to work properly a few things need to be configured.
Ignore canonicals
Because Discourse comes with a canonical link to your homepage, baked into the default/core setup, you’ve got to tell your Fathom embed script to ignore canonicals:
<script src="https://cdn.usefathom.com/script.js" data-spa="auto" data-site="YOUR-SITE-ID" data-canonical="false" defer></script>
This will then show unique URLs within your Discourse site, not just your homepage.
Add SPA tracking, set to auto
Because Discourse uses pushState navigation, you’ve got to turn the data mode to auto, by adding data-spa="auto"
, like so:
<script src="https://cdn.usefathom.com/script.js" data-spa="auto" data-site="YOUR-SITE-ID" data-canonical="false" defer></script>
Add the Fathom embed code to you CSP
Discourse requires you to add all external scripts (like Fathom’s) to your content security policy, in Settings in Discourse.
Further customization
To learn about all the options we offer, read our advanced documentation here.
If you still have questions or require help with anything, please reach out to us and we'll happily get things sorted out for you.