Closed samip5 closed 2 years ago
How about just allowing to add some custom code into <head></head>
section. Then one change will allow to use whatever analytics tool you want.
That would work too.
Thanks. The goal of the docker container is to keep it simple. Currently Google analytics is as simple as adding your tracking Id, then analytics and button clicks are wired up automatically. I'd like to do the same for any additional analytics system that is added, rather than injecting scripts via env variable.
I am happy to write this integration but I have no easy way of testing it, outside of hosting/creating my own account
This is the code for Matamo:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//samip.fi/matomo/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '1']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- Image Tracker-->
<img src="https://samip.fi/matomo/matomo.php?idsite=1&rec=1" style="border:0" alt=""/>
<!-- End Matomo Code -->
SiteID and the URL to the matomo instance is the most things it would need.
Any progress on this? :)
@kenjibailly nope but PRs are welcome! In my experience, the person that cares about it most will add this feature.
I def want to look on how to implement it, but I'm just a hobbyist coder and have no idea how you link your variables to docker. Some pointers would help me out try to make it happen :)
I figured it out and made a pull request for this here: #111
Edit: added image tracking in #112
Please add support for Matamo (https://matomo.org).