Matomo Integration

If this exists, please point me in the right direction. I am looking to move from WordPress to WriteFreely and I am testing an instance and I want to be able to install Matomo js code in the header for all public website pages in WF, where would I insert this code, which file?

Thanks in advance!! Blessings!!

hi @g29h9ZjS4Y2d42FmCG9D, if you are running your own instance you can edit the templates directly. Look in the directory templates/, you will probably want to add it to the <head> of the file base.tmpl.

I would suggest creating a new file like matomo.tmpl, which will contain the script to be included. It will look something like this:

{{ define "matomo" }}
<!-- matomo script -->
<script type="text/javascript">
// all the script contents here
<!-- end matomo script -->
{{ end }}

then you can include this template in any of the other templates with {{ template "matomo" }}.