Jump to content

Time Spent on Page


NeoMarine

Recommended Posts

Do you have any ideas on how to record the time spent on a page?

 

I have a website which allows people to play games (for example) and I want to track how long they are on the "play game" page before exiting/browsing to another page or closing window.

 

I know that Google Analytics can do this, but how?

Link to comment
https://forums.phpfreaks.com/topic/120058-time-spent-on-page/
Share on other sites

not a accurate way as such, but.... you could store the time they entered the page in a session variable, and do the same for each page. With that you can workout the time in between to give you how long they were on the page.

 

Otherwise.... If you want it to be dynamic. Use Javascript or AJAX.

Link to comment
https://forums.phpfreaks.com/topic/120058-time-spent-on-page/#findComment-618470
Share on other sites

The first method you mentioned will not work for my specific scenario, as they would open a "pop-up" window and it does not navigate to anywhere else, so I would not be able to track the time "after" since I could only store a session at the beginning, when they opened the "pop-up" window.

 

Do you know any specific javascript/ajax related methods? I cannot find a solution through search engines or forums.

Link to comment
https://forums.phpfreaks.com/topic/120058-time-spent-on-page/#findComment-618499
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.