Daily unique hits on pages |
[eluser]Unknown[/eluser]
First of all, Greetings to community of the best framework around. My question is as follows: I am currently building a Real Estate advertisement website and I need to track unique daily visits for every advertisement. And what concerns me the most is how to properly log the user. I checked the input class -> ip_address, well it works fine, but how do I log separately users who are behind e.g. router?
[eluser]andyy[/eluser]
I would use Code: $this->input->ip_address(); This applies to multiple users behind a router with NAT as well because the presence of a cookie differentiates unique/returning visitors.
[eluser]Twisted1919[/eluser]
[quote author="Battery" date="1293515390"]First of all, Greetings to community of the best framework around. My question is as follows: I am currently building a Real Estate advertisement website and I need to track unique daily visits for every advertisement. And what concerns me the most is how to properly log the user. I checked the input class -> ip_address, well it works fine, but how do I log separately users who are behind e.g. router?[/quote] What you want is pretty hard to accomplish and to be 100% bulletproof. Think that, there are connections behind proxies (100% anonymous proxies or just partial) and it is very hard to determine the real IP of a user coming via a high anonymity proxy. I don't know if you are familiar with TOR ( http://www.torproject.org/ ) but it worth a look to understand how proxy works . Also, the $_SERVER['HTTP_X_FORWARDED_FOR'] should give you a hint. If you figure it out on what's the real ip address, even if it is forwarded, then, using the obtained IP + Browser user agent should be more than enough . P.S: As far as i know, MYSQL is not recommended for these kinds of scripts, but i might be wrong, it is also a thing that you will need to investigate . |
Welcome Guest, Not a member yet? Register Sign In |