Sign inFree trial
Support home / Integrations

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="" 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="" 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.

CSP update in Discourse

Make sure to update the above examples with your custom domain

Note that if you use a custom domain, you’ll need to change in the examples above to your own custom domain, for example

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.