Jump to content

Archived

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

mmosel

How do you handle guest tracking?

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?

Share this post


Link to post
Share on other sites
http://www.phpfreaks.com/tutorials/62/0.php

that starts but there are tutorials on

http://www.phpfreaks.com/tutorials.php

Share this post


Link to post
Share on other sites
Thanks, but that's a tutorial for who's online. I am building a deeper tracking system that will track return visitors - and using the IP address is not smart for this.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.