When designing a website, it’s important to collect metrics. With the right data, you can learn more about how users are viewing your site, which elements seem to draw their attention more, and what parts you can change. Since mouse movement have been found to be highly correlated with what users look at on a site, a good metric to obtain would be data on the user’s mouse movements. This can be done simply and anonymously through a jQuery script.
First, to get the mouse’s position whenever it moves on the page, we can write a simple event listener:
Creating an object to store the x and y values at certain times, the tracker can generate an array of objects that track the mouse position at every moment in time. However, this is overkill. There will be a ton of data generated for every page every time the user moves…
View original post 103 mots de plus