what is the most effective way to keep records of number of uniqie article views

I am trying to create an article based website using codeigniter. When any article is requested to fetch from database for viewing, I use the following code to mark the number of unique view of each article in a separate table called "hits".\[code\]mysql_query("INSERT INTO hits(ip,article_slug,hitcount) VALUES('$ip_address','$id',1) ON DUPLICATE KEY UPDATE hitcount=hitcount+0");\[/code\]I take the IP address of the user and get the value of article_slug from $this->uri->segment(3);and then run the above mysql query.I am using the IP address here to get the number of unique views, but it suddenly occurs to me that several people could be using the same IP address. So in that case my query above doesn't seem effective. So I was wondering what is the most effective way to do it. One of my friends was talking about doing it using cookies instead of IP address. Do you think its a good idea or there is a better way of doing it? Could you please give me an idea on how to do this?Thanks in Advance :)
 
Back
Top