Important msg for Matomo users
While browsing Google Search Console today, I discovered that GoogleBot was only loading small section of my product pages.
Error from GSC: "Page resources. Failed to load 1/57 of resources"
GoogleBot was blocking by matomo.js file.
The solution is simple, add following line to script:
_paq.push(['disableAlwaysUseSendBeacon']);
Example of full code with added line:
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['disableAlwaysUseSendBeacon']);
(function() {
var u="https://store-domain.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
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>
If you are using Matomo Web Analytics module add code to file: /modules/piwikanalyticsjs/views/templates/hook/jstracking.tpl (line 27)
I discovered this when I saw that the number of reviews visible in a Google search had started to fall rapidly.