How can I embed tracking JS into Discourse

I’m using Fathom Analytics and trying to embed some JS script for site tracking, which looks like this:

<!-- Fathom - simple website analytics - -->
(function(f, a, t, h, o, m){
	o.async=1; o.src=t;'fathom-script';
})(document, window, '//', 'fathom');
fathom('set', 'siteId', 'ABCDEF');
<!-- / Fathom -->

I’m adding this to <head> section via the Customize > Theme > Custom CSS/HTML settings.
But when I load the side the fetching of the Fathom tracker.js script fails:

And the console show other failures:

Uncaught (in promise) no-response: no-response :: [{"url":""}]
    at a.makeRequest (

It seems like Fathom is messing with the fetching of that JS. How am I supposed to do this?

I’m on 2.6.0.beta1.

Oh, and I should also add that I have seen this:

And have added my Fathom domain to allows ones in the Content Security Policy allowed domains.


Hey @jakubgs

digging out this oldie!

Have you been able to make it work? I am considering fathom to replace google analytics.