Logging page dwell times in CakePHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Logging page dwell times in CakePHP

Post by mattcooper »

Hi all,

Does anyone know a good way of logging the time users spend on each page of a site in CakePHP? My idea is to use $this->session->read() to provide the current session "time" element and use the write() method to place a retrospective element in the array that can be used to calculate time between pageloads. This works in theory, but I'm unable to test it because I don't know how to access the "query()" method from appController.

Has anybody done this? I'd like to avoid bypassing the databased abstraction by writing a raw query in appController.

Thanks in advance...
Post Reply