All approaches will have their drawbacks. Cookies may not be enabled in the browser, IP addresses may be duplicated due to NAT (I know at our work, all traffic to the outside world looks like it's coming from one IP address) or reused due to DHCP.
It depends on what you're going to use the information for. If you want to know how many unique people are viewing your site, that's incredibly difficult since many people may use one browser or IP address.
I would think most people are interested in how many useful accesses are made. This means that, even if the same IP address comes back one week later, that should count again.
We've used that exact system (and made sure our clients realize it's an imperfect one). Store the IP addresses and first and last date of access in a table.
If it's a newly added IP address, add one hit and store IP/dates. If it's an already existing IP, update the last date. Do a nightly sweep to remove IP's whose last date is older than 7 days or whose first date is older than 14 days (both configurable).
That way you catch the useful accesses:
- people who visit continuously are assumed to have a useful access every two weeks.
- people who visit then disappear for a year and visit again have had two useful accesses.
- people who visit once have had one useful access.
As long as the inadequacies are understood, they can be managed.