Jump to content


Photo

How do you handle guest tracking?


  • Please log in to reply
5 replies to this topic

#1 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 02 August 2006 - 01:14 AM

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?

#2 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 02 August 2006 - 06:47 AM

http://www.phpfreaks...orials/62/0.php

that starts but there are tutorials on

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

#3 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 02 August 2006 - 08:03 AM

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.

#4 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 02 August 2006 - 08:06 AM

in the tutorials is a way to do the unique thing  too

#5 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 02 August 2006 - 08:44 AM

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.
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#6 mmosel

mmosel
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts

Posted 02 August 2006 - 09:49 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users