1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need a tracking PHP Script – “how long people stay on the website?”

Discussion in 'PHP' started by AimyThomas, Sep 10, 2012.

  1. AimyThomas

    AimyThomas Banned

    Joined:
    Aug 28, 2012
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    0
    I want to know, is there a way to track how long anyone has been logged into website and then insert it up for each time they have logged on.

    In case, user a logs in for 30 minutes, then later comes back and logs in for an hour, then later comes back and logs in for 50 minutes,

    Add it up equal 2 hours 20 minutes. Is this possible?

    Thanks
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Yes very much possible.

    What you can do is there should be start timer when user is logged in and and in each page load or anything that timer makes an entry like end timer and the final entry would mean amount of time he was online.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Moved to PHP forum
     
  4. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    use cookies for that
    simply update the cookie stored in user's browser each time he comes to the site
    only problem will be the deleting of the cookies by the user
    but for random statictics this method is used
     

Share This Page