Location identification based on IP should only be used for Country identification and not City or other more specific location information. Latitude, longitude, IDD code, etc are not reliable!
Your IP address is determined by your ISP's Data Centre. Their location is unlikely to be where YOU are! I'm frustrated with being offered "local services" which relate to the City where my ISP operates from and is half way across the country from me, and therefore totally useless!
Certainly use this for country detection (but even this may be wrong in certain places in Europe) but please do NOT use it for anything more exact.
Dave Smith - 2015-12-17 02:07:21 - In reply to message 1 from PHP-4-Business
It is the best we have, at the moment, that does not require users permission to access their geolocation.
If locality is important to the operation of your website, you should have a method for users to specify their location and drop a cookie to remember their choice. Use ip2location as a fallback when the location cookie is not present.
PHP-4-Business - 2015-12-17 18:58:31 - In reply to message 4 from Manuel Lemos
I agree with the above. I just wish these data suppliers would stop providing all the 'unsafe' information.
They think they are being clever by providing a "rich data set", but all they are doing is enabling a poor customer experience. If the data are there then someone, sooner or later, is going to use it without considering whether it is wholly accurate ("it's in the data set so it must be true"!)
Manuel Lemos - 2015-12-18 00:14:32 - In reply to message 5 from PHP-4-Business
I did not see any of these geolocation data providers claim the data is 100% accurate. What I saw is that the paid versions are more accurate probably because they are more upto date, I am not sure.
Given that it is up to the user to make sensible use of data that may not be as accurate as necessary for certain applications.
I agree that some users may misuse data as if it is highly accurate, but that is their mistake, not the data provide fault.
Anyway, the article gives some examples of uses of this geolocation data, like adapting the content for the user country. That is an useful purpose that does not require greater accuracy.
For instance the PHP Classes uses IP2Location to determine the user country from his IP address. Still the user is prompted to confirm it.
The country of the user is used for many purpose like for instance show how the user is ranking in several types of rankings among the user of his country.
Also every month the site encourages users to help their country to rise in the Innovation Award Championship by country ranking. For some countries the site sends messages in the country official language to make it easier to explain.
PHP-4-Business - 2015-12-28 18:18:41 - In reply to message 7 from Alexander Skakunov
I think it depends on the size of your country and its geographic make-up. For me the city data is worse than nothing. I often visit websites and get targeted adverts for "local" services which relate to the IP "City" which is over 200 miles away from where I am. That might not be far in some countries but in the UK that's a h-u-g-e distance; its not the nearest city to me, not even the second - in fact it's about the 8th nearest city!
Nor is it the same "region" ('County' in UK geographic terms) as me - it is 3 counties away from me.
Maybe in some countries you have to sign up with the ISP which is nearest to you (e.g. with your telephone provider), but that's not the case in the UK; I can choose an ISP at the other end of the country if I want.
In some cases 'any data' really is worse than nothing.
The only thing accurate on the IP2Location report for my IP is the Country and Timezone, and maybe that's all we need.
Manuel Lemos - 2015-12-28 18:45:11 - In reply to message 8 from PHP-4-Business
Yes, even though regional location may not be accurate many times, it may also be accurate many other times.
If getting regional location accurately is important to you, what you can do is to ask the user to confirm his location details. If it is right, he just confirms. If it is not right he can edit it.
I do that when setting the user country in PHP Classes.
For other situations on which you cannot ask the user, like showing geotargetted ads, the ads may be off site some times, but other times they will be correct. So there is value in this partially inaccurate data.