MeatballWiki

Edit History Raw

MouseTracking

Similar to EyeTracking, it is now theoretically possible to track mouse movements and clicks in a browser window for modern browsers. To do this successfully, ideally one needs to

  • Detect the layout geometry of the page
  • Track every mouse action in the browser
  • Transmit this information to the server
  • Map the mouse data against the layout geometry, and then transform this data to a canonical rendition to aggregate results

In practice, this is not very easy. You cannot simply put, say, an invisible div on top of the whole document because some popular user-agents such as FireFox use a BoundingBox calculation to determine what is clickable (probably the Right Thing To Do). That means, even if you can see a link, you may not be able to click on it if there is something on top of it. You could simple put an onmousemove event handler on the body, provided no one above the body cancels the bubbling of the onmousemove event. Of course, there is no easy way to tell.

One approach may be to walk the whole DOM tree and override the mouse events for every element. One would have to remember what event handlers were previously there and call them, of course. For this to be successful, the mouse tracker would have to be the very last script executed. However, it could fail in the face of dynamic HTML, such pop-ups or dynamic adjustments to the mouse handlers.

Finally, one can send the data using an XMLHttpRequest object, either all at once via the onunload event or continuously. The latter option is particularly useful if you are trying to build a SharedCursor between users.

One company that claims to be able to do this is http://www.crazyegg.com which is in perpetual closed beta at the time of this writing.

Resources

CategoryWebTechnology