Jump to content

How do you handle guest tracking?


mmosel

Recommended Posts

What is your method for tracking guests and returning guests?

I'm working on a system where I will set a unique cookie for each guest (or try to). I'm trying to decide if generating a random string is sufficient or if I should use an auto-increment value. If I use the random string, there there is the ever so slight possibility of a duplicate. If I use an auto-increment, then I'm going to have so many non-used numbers it's not even funny (because every time there's a new hit to the home page I would attempt to insert a cookie, which would be an auto increment value).

So, how do you or how would you handle this?
Link to comment
https://forums.phpfreaks.com/topic/16275-how-do-you-handle-guest-tracking/
Share on other sites

I store the timestamp of the exact time they first visited along with a random number, this pretty much guarantees a unique number. Beware that some people do not accept cookies and then you need to look at other things to identify them such as IP address, user agent, etc.
Yeah, thanks for that mr. King. :) I was going to go for the random number, but I decided on auto-increment. I already have a full page_logs table, with ip, user_agent, referer, page, etc. But I want to track repeat visits by guests, and then members who aren't logged in, and then of course while they are logged in. I record raw data, and then run a cron job to filter out bots in the auto-increment table. I'm still working out how I'll process some of the data, but that's another story.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.