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

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

  1. #1
    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
     
    AimyThomas, Sep 9, 2012 IP
  2. stras77

    stras77 Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The thing is that PHP only runs on page load meaning that you can't track how long the user is on the same page, unless he moves on to a new page. I would suggest taking a look at some JavaScript or Jquery - Link: adf.ly/ChX1z
     
    stras77, Sep 10, 2012 IP
  3. Charles.Roger

    Charles.Roger Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can use Using AWStats to generate portal usage report
     
    Charles.Roger, Sep 12, 2012 IP
  4. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #4
    I saw this on a site that has a timer to count how long a user is on a page, you could perhaps use that counter to store to a database or file when the user leaves and counter stops
    if its writing it to a file and stops overwriting when they're gone ?
     
    ezprint2008, Sep 13, 2012 IP