grungefreak Posted May 29, 2010 Share Posted May 29, 2010 Hi, I want to record the time each logged in user spends each web page of my site. I do not want to use google analytics but would prefer to use custom code or a jquery plugin. This time would then be sent to a database for analysis later. Any guidance would be great as I am not to good with javascript. gf Link to comment https://forums.phpfreaks.com/topic/203279-record-time-spent-on-each-web-page/ Share on other sites More sharing options...
ignace Posted May 29, 2010 Share Posted May 29, 2010 <body onload="startRecording()" onbeforeunload="endRecording()"> start- and endRecording() needs to be defined by you. Link to comment https://forums.phpfreaks.com/topic/203279-record-time-spent-on-each-web-page/#findComment-1065047 Share on other sites More sharing options...
grungefreak Posted May 30, 2010 Author Share Posted May 30, 2010 Thanks for the pointer. If i subtract timestamps I can get a value which is fine. The bit i'm unclear about is how I then store this in a variable for insertion into a database? GF Link to comment https://forums.phpfreaks.com/topic/203279-record-time-spent-on-each-web-page/#findComment-1065338 Share on other sites More sharing options...
ignace Posted May 30, 2010 Share Posted May 30, 2010 The bit i'm unclear about is how I then store this in a variable for insertion into a database? Use Ajax to communicate with the PHP side to store the information. Link to comment https://forums.phpfreaks.com/topic/203279-record-time-spent-on-each-web-page/#findComment-1065417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.