My point was that Matomo is PHP, but your website doesn't have to be on the same stack.
Normally the analytics platform should be hosted on a separate server for performance and security reasons.
For example, the demo dashboard of uxwizz.com runs on PHP/MySQL on a $5/mo VPS and it's faster than most analytics platforms, even those running on big cloud infrastructures, because for the low-traffic use-case the simpler the solution and technology, the better.