docker
docker copied to clipboard
Wrong address in tracker code
using docker-compose from .examples/nginx, then running all necessary steps to get the first web tracking code, then I noticed it's displaying internal docker IP (172.18.0.2) instead of the current address (134.209.75.24:8080) in the tracking code
<!-- 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="//172.18.0.2/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
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 -->
Notes: to get Docker internal IP, https://stackoverflow.com/a/20686101
EDIT: the address seems to be correct from dashboard page
Can reproduce too. Matomo has no clue about the external domain it's being hit from. Any environment variable for this?
Maybe https://github.com/matomo-org/docker/issues/210 or https://github.com/matomo-org/docker/issues/295 help here.