Context: we have a responsive web application developed in React.js, which we have successfully used a few times to run user studies on Amazon Mechanical Turk. Now, we would like to add interactivity tracking to this app. Concretely, we want to track interaction events, which can be either multi-touch gestures (pinch, zoom, swipe, tap, etc.), mouse clicks, scrolling, etc. We would like to keep track of these things in real time and save them in the app's DB, which currently is a relational database (Postgres). There are many engineering decisions to make, from the library (if any) to use for tracking interactivity events, the granularity of the events (especially for events like pinch, zoom, swipe, scroll which can fire a lot of times per second) and also how to efficiently send the data back to our server and how to store everything in the DB, without degrading the user experience of potentially hundreds of users using the app concurrently.

Does anybody know how to accomplish something like this? Any help will be very appreciated.


Not sure about "easiest", as I know there are several different packages and off the shelf solutioms you can use. But doing this manually isn't super hard.

Bind javascript events to the things you want to record and have them call a simple api to record the data.

The challenging part as you say is dealing with, say the slow moving of an mouse across the page. Do you send the position every 100ms? not impossible, but perhaps more info than you need to send.

I think the usual approach is to either batch up the data for less frequent sending, or to collect less data. ie just business events, user clicked buy, user opened menu etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.