iggypop
06-27-2003, 12:43 PM
Question: is there any script to count how much time visitor spent an website? thanks in advance
|
Click to See Complete Forum and Search --> : asp counter iggypop 06-27-2003, 12:43 PM Question: is there any script to count how much time visitor spent an website? thanks in advance Ribeyed 06-27-2003, 02:52 PM Hi, that’s not as easy as it sounds. Basically you want to know the length of a visitor’s session. When a visitor enters your site you can log the date and time to a database using code in the Session_OnStart. That’s straight forward, its logging the exit time which is the problem. You can't connect to databases in the Session_OnEnd, so you can't automatically log the exit time. One way around it is to assign a sessionID to each visitor, log the date and time of start of session, then include on every page more code that would log the date and time the user visited each and every page in your site. Within your Session_OnStart you set the session time out to a particular length of time, then you can work out from the last page logged for this visitor + the session time out which should give you an approx. exit time which you then use to calculate the length of the session. Hope this helps webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |