Paolo G
Hi,
After upgrading a site from Joomla 4 to Joomla 5, I had to exclude the js files on the CDN because there was an error in Matomo's tracking.
Without the CDN, the tracking code is this:
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
// Add the Heartbeat Timer for accurate time spent tracking
_paq.push(['enableHeartBeatTimer']);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDomains", ["*.www.domain.com","*.domain.com"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://stats.supporthost.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '155']);
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>
<noscript><p><img src="https://stats.supporthost.com/matomo.php?idsite=155&rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
With CDN, the code is this:
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
// Add the Heartbeat Timer for accurate time spent tracking
_paq.push(['enableHeartBeatTimer']);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDomains", ["*.www.domain.com","*.domain.com"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://stats.supporthost.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '155']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'https://domain-8806.kxcdn.com/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="https://stats.supporthost.com/matomo.php?idsite=155&rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
You can see how
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); is changed to
g.async=true; g.src=u+'
domain-8806.kxcdn.com/matomo.js
'; s.parentNode.insertBefore(g,s);, but it is not present in the CDN: is this normal behavior?
On the other sites, where I use JCH to serve the CDN, the problem did not appear after the Joomla update.
Thank you