Analytics on mouse behaviours

I was wondering id one could use javascript to record Button clicks and mouse overs.
or perhaps if there is a library one could use in Hype.
The aim is to save it in a simple text file or to log it in a MySQL table
Would like to here from anybody that have gone this route just to determine what my best options are.

Many Thanks
Peter G

I regularly use Google Analytics to capture user actions within my Hype projects. Basically anything that can have a small JavaScript snippet attached to it, can be captured. That part is easy. Making sense of the data, not so easy. You have to be a very skilled user of GA to make sense of the data.

If I had to track user actions in a Hype project, I'd probably use Matomo. It has JavaScript based event tracking...

If you do go with Google Analytics, here's a guide: