# Add Plausible Analytics or Fathom tracking to Discourse

**URL:** <https://meta.discourse.org/t/add-plausible-analytics-or-fathom-tracking-to-discourse/173310>\
**Category:** Data & reporting\
**Tags:** guide, analytics\
**Created:** [December 14, 2020, 11:11pm UTC](https://meta.discourse.org/t/add-plausible-analytics-or-fathom-tracking-to-discourse/173310 "2020-12-14T23:11:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/580155_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)\
**Post date:** [December 14, 2020, 11:11pm UTC](https://meta.discourse.org/t/add-plausible-analytics-or-fathom-tracking-to-discourse/173310/1 "2020-12-14T23:11:26Z")

</div>

## [Plausible Analytics](https://plausible.io/)

- First, add your domain to your Plausible Analytics instance and grab your tracking code. It should look something like this:

```js
<script async defer data-domain="community.example.com" src="https://plausible.example.com/js/plausible.js"></script>

```

- Create a new theme component from **Admin \> Customize \> Themes**.

- Then paste the tracking code in the `</head>` section.

- Click **Save**.

**Make sure to add this to all available themes so you can track analytics across all users!**

_That’s it!_

> ℹ If you don’t see data flowing, the script may be blocked by your CSP settings. Check your browser console and if you’re getting errors, add `https://plausible.io/js/script.js` to your CSP settings.

* * *

**Edit:** Adding the Fathom or Plausible Content security policy script src is no longer required due to this update [Content-Security-Policy now uses 'strict-dynamic'](https://meta.discourse.org/t/content-security-policy-now-uses-strict-dynamic/298172)

## [Fathom](https://usefathom.com/)

Please see the Fathom guide for Discourse.

_ **Updated May 14, 2025 with Fathom’s guide for Discourse** _  
For further info, see Fathom’s guide here:

> **[Discourse - Fathom Analytics](https://usefathom.com/docs/integrations/discourse)**
>
> Add analytics to Discourse with Fathom.

**Note:** For both Plausible and Fathom, their scripts work fine in a component attached to your theme(s) _ **and** _ inserted into head of each template you want to track. The new guide from Fathom does not use the “component method”.

---

_[View the full topic](https://meta.discourse.org/t/add-plausible-analytics-or-fathom-tracking-to-discourse/173310)._
