I have dug into this topic a few different times over the years.
https://en.wikipedia.org/wiki/StatCounter
Initially I went with StatCounter. I liked how it could show visitor paths and the map of where people were coming from. I also liked seeing the size of the screens they were viewing from and what browsers they were using. The free tier has the last 500 or 2000 interactions.
I set it up on a bunch of Wordpress sites and other places.
https://en.wikipedia.org/wiki/Matomo_(software)
Then I looked into Piwik, since I was into self-hosting just about everything and it sounded straightforward.
PHP + MySQL and I had my own analytics box.
They rebranded to Matomo a while ago.
At another place I worked they had their own branded internal tool "Patriot". It didn't have all the features I wanted.
What about sub page interactions and tracking? I haven't delved into it, even though I worked for an eye tracking company for a while.
https://en.wikipedia.org/wiki/Google_Analytics
The reigning champion, GA. Their trackers litter the internet on many sites and they have a huge suite of tools. I haven't dived deep into them but they can do just about everything.
https://firebase.google.com/docs/analytics/
I've nearly turned this on a few times and since getting purchased by google, this is effectively, just enabling Google Analytics and more by default into the Firebase app from my understanding.
https://www.reddit.com/r/learnprogramming/comments/ebiqlb/what_does_sentryio_do_exactly/
What about crashes and clientside javascript errors? Error boundaries and catch these and you can see what is going on.
Sentry.io has a pretty generous free tier and great support for a lot of modern frameworks.
I've rolled by own in the past where I just make a dedicated api route for logging errors, and when an error gets caught in the JS on the frontend, it captures the stackframe and sends it over to the api side quickly. This works well in an airgapped setup.
Sentry.io is fantastic for helping in this case. When something doesn't work in a iPhone or iPad using your app and you are testing on Android and it is hard to see what in the world is happening... This helps. Otherwise run a copy of Safari on your dev machine and check once in a while.