I’m trying to time how long my visitors stay on my salespage.
i’m using php to save a file with their ip like this 255-25-52-32.php,
it simply holds a single line of text, their entry time and their exit
time seperated by a pipe symbol like this “02:08:15|02:09:03”,
of course i could just save the actual timelapsed or add it as a 3rd
variable, but i like knowing the time of day they arrived.
anyways, my problem is how to i do i detect when they are leaving
and update the exit time right before they leave.
i know a lot of javascript and was trying to use onunload=”” in the
body tag, but it seems to be closing before it records the exit time.
any ideas on how i can use php or javascript to grab their exit time
when they close or leave the page?
thanks for your help guys
edit: i’ll probably store the info in a single file or database, but i was
using the ip as the file name just for testing it out. i’ll polish it up
later.