Jump to content

Track the time a user is on a website


kratsg

Recommended Posts

What we're to be doing is implementing a referral type program on the site. Assume the following, Person A refers Person B to the site, it's stored in the database that Person B's referrer is Person A. So then, for each second Person B is on the site, we add one point to Person A's referral points (also set in the database).

 

How can we track the user accurate enough (to the seconds) so that once Person B leaves the site, we know exactly when Person B closed the browser/went somewhere else, how long Person B was on the site, and simply use that info to give Person A his deserved referral points.

 

We have access to our php.ini file for w/e reason, we've got database access, we can basically do anything w/ php, and such. Any ideas on how to do this? My only idea at the moment was to check every 5 minutes who was active in the past 5 minutes, and clear anyone who wasn't, but that didn't seem accurate.

Link to comment
Share on other sites

See, that's actually my problem. There's soo many things that could happen.

 

Say a user is on the same page for a while, so after 5 minutes, they're considered to be logged off. Then if they move, they are 'on' again... It doesn't seem to be a way to check whether they navigate off or something? It'd be nice to have something more accurate.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.