It's a very small level !
I tried to put the code (the code is ok : it works on other site, there is just to change a number) :
<html>
<head>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//augras.eu/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '6']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<noscript>
<!-- Matomo Image Tracker-->
<img referrerpolicy="no-referrer-when-downgrade" src="https://augras.eu/matomo/matomo.php?idsite=6&rec=1" style="border:0" alt="" />
<!-- End Matomo -->
</noscript>
</head>
</html>
in a addon subst file (UltimateMenu.subs.php, and some others) but get the error
syntax error unexpected 'trackPageView' (T_STRING), expecting ';' or ','
But maybe it's not what you mean ?
Maybe it will be a good idea to make an addon to put some scripts easily in head and in body ?
You understand i can't do that .
Philippe