We have a small website getting about 90K users per day and are hosting Matomo (v4.14.2) for analytics data. We’ve been using the default JavaScript tracking code as given by our Matomo install, store it in a separate .js file and load the file near the end of the page contents (but inside the body tag). Due to technical constraints we cannot change how the script is loaded.
We recently had an issue when our Matomo server became unavailable because of incorrect network configuration. This also caused performance issues on our website when the browser tried to load URLs from the Matomo server and waited until the request timed out, resulting in 20-120 second delays before the page contents were fully loaded and visible to the user.
Looking at this post from '19 Matomo Performance (Page Speed) it sounds like Matomo being slow shouldn’t slow down our website, as it should be loaded asynchronously and deferred, but this is not what we observed when our Matomo server was unreachable.
When searching for solutions how to avoid this issue in the future I came upon this blog post Different ways of embedding the Matomo tracking code for faster website performance - Analytics Platform - Matomo and embedding the tracker after the load event as recommended here seemed to solve the issue.
Since this blog was written in 2017 I wanted to ask the community if this is still the recommended way to make sure Matomo being slow/unavailable doesn’t affect the main website performance?