Search
Other CDN for Joomla! questions
Forum

Problem after upgrading to Joomla 5

Paolo G's Avatar 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&amp;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&amp;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
Peter van Westen's Avatar Peter van Westen ADMIN
It is probably due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Paolo G's Avatar Paolo G
Hi Peter, thank you.

Actually the order of the plugins was a bit wrong, but even reordering it as follows doesn't help:

System - SEF
System - Regular Labs - CDN for Joomla!
LiteSpeed Cache Plugin

These above are the last plugins on the list, in their order

Best regards
Peter van Westen's Avatar Peter van Westen ADMIN
Weird, as there is no difference in code between the Joomla 4 or Joomla 5 version of CDN for Joomla!
It is the same code.

Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Confidential information' button in the forum editor to hide sensitive information.
Please post a rating at the Joomla! Extensions Directory
Paolo G's Avatar Paolo G
Weird, as there is no difference in code between the Joomla 4 or Joomla 5 version of CDN for Joomla!
It is the same code.

It certainly is as you say, however this occurred after upgrading from Joomla4 to Joomla 5 and is affecting another site with the same setup. Another site of mine that works with JCH's CDN didn't see the same problem after the update.

I'll send you the accesses, thanks.

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Can you also give me (s)ftp access so I can take a deeper look?
Please post a rating at the Joomla! Extensions Directory
Paolo G's Avatar Paolo G
Thank you

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Please try the latest development version from:
regularlabs.com/development-releases
Please post a rating at the Joomla! Extensions Directory
Paolo G's Avatar Paolo G
Dear Peter,

I confirm that the update resolves the reported problem. Thanks for your assistance

Best regards
Peter van Westen's Avatar Peter van Westen ADMIN
Ok, great 🙂
The fix will be included in the next release.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription