title: Tracking visitor IP/Clicks in PHP
body: <p>I am trying to write a script or more like come up with a simple logic to track clicks or visits.  I don't need to track each page, just as long as they land on the homepage is where I want to store it as 1 click.</p>
  
  <p>First of all, is it safe to say that tracking by IP is far from accurate because many users can be under the same IP?</p>
  
  <p>Currently my logic to do this is set a cookie on client side with a flag when they land on the homepage for the first time.  At that point, I would update the database with 1 unqiue click as unique.  Then each time this same visitor visits, the homepage would check for the flag and if it exists, update the database with 1 raw click....etc.</p>
  
  <p>I do know that if they dump their cookies, it would throw off the data but generally, is this how it is done?  </p>
  
  <p>Do you have a better way?</p>