Adding Custom Analytics Script to HEAD in WriteFreely
This morning, I wanted to add self-hosted analytic script, Umami, to this site. I always liked the colourful graph and stats of a website traffic, and this should be a privacy-respecting way to do it without giving into the dreaded Google Analytics.
One of the joy of hosting your own blog is that you can customise it to your own liking. It should be noted, however, that you need some expertise to do what you want.
Customising WriteFreely isn't a well documented feature, so you would need to scour the web a bit for a way to do it. I have done it before, albeit by awkwardly editing the files, with the Fediring footer down below.
However, I wondered if there are simpler way to do it?
Turns out WriteAs Discourse has the answer.
I tried the method explained here, inserting it in the easy-to-access Custom CSS in the Dashboard.
This method works by dissecting the custom CSS, that is conveniently placed in
<HEAD> by inserting a
</style>, thus closing the CSS. Then you insert your custom script there, and opened a new
<style> again so it doesn't break your site.
A crude method, but it does work. There is a more elegant way explained here, but i haven't made it work. It threw
no such template "umami" everytime i tried it, so I must've made some mistake. If have made it work, please do contact me!
Until WriteFreely provides a documentation for customising the site, it should serve as a shortcut, since i believe for all WriteFreely simplicity, it doesn't intend to cater to everyone's need.