# Matomo Integration

**URL:** <https://discuss.write.as/t/matomo-integration/694>\
**Category:** WriteFreely\
**Created:** [June 25, 2019, 1:59pm UTC](https://discuss.write.as/t/matomo-integration/694 "2019-06-25T13:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g29h9ZjS4Y2d42FmCG9D](https://discuss.write.as/user_avatar/discuss.write.as/g29h9zjs4y2d42fmcg9d/32/304_2.png) [@g29h9ZjS4Y2d42FmCG9D](https://discuss.write.as/u/g29h9ZjS4Y2d42FmCG9D)\
**Post date:** [June 25, 2019, 1:59pm UTC](https://discuss.write.as/t/matomo-integration/694/1 "2019-06-25T13:59:40Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![robjloranger](https://discuss.write.as/user_avatar/discuss.write.as/robjloranger/32/291_2.png) [@robjloranger](https://discuss.write.as/u/robjloranger)\
**Post date:** [July 3, 2019, 8:24pm UTC](https://discuss.write.as/t/matomo-integration/694/2 "2019-07-03T20:24:33Z")

</div>

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:

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

```

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