I am looking for to calculate how much time a visitor read my post using JavaScript. Like I have
3 div. each div contains information when visitor read any div I will calculate the time. it will not work when somebody scroll down not staying on the div. User must stay on the div. Each particular div will generate its own reading time. Actually I did not implement any code. Looking for a better solution. Thank you
Well, surely you need to see where their eyes are pointing: you’ve got to physically record them looking at the screen, track their eye position and calculate if it’s the right element they’re looking at. You can’t just use JS, you need a physical recording device pointed at them.
You can check how long they interact with an element without that (just use Google Analytics or similar), but they aren’t doing that, they’re not going to be clicking stuff, they’re just reading it.