Tell me more ×
Answers OnStartups is a question and answer site for entrepreneurs looking to start or run a new business. It's 100% free, no registration required.

What is the best way to handle signups for new users when you want them to register anonymously but identify their country, city and Zip/Postal code? Some countries don't have postal codes. I would like to be able to show user location on on Google Maps. Are then any API's to handle this process in a clean way?

share|improve this question

3 Answers

You can grab user's IP address during sign up, find out his location based on that IP address and then use the location info for google map. Here are couple of solutions that you can use to find out location based on IP

  1. MaxMind

  2. IP2Location

share|improve this answer

I can suggest MaxMind and if you use nginx web server NginxHttpGeoIPModule that can be used with MaxMind.

share|improve this answer

The answer to that comes in 3-parts:

  1. The best way right now is probably to ask the user with a form, preferably a spiffy Javascript driven one that appears in a context where it's useful for the end user. Ideally you'd ask the user for as little as possible, and then put together a precise location on your backend. F.x. you could present the user 2 inputs, "Country" and "Zip code or City", and then normalize data on your back end.

  2. In the long term, the HTML5 Geolocation APIs are going to be the preferred way of handling this. There is very limited browser support for this already, fx Google Chrome 5 and Firefox 3.6 support draft versions of the spec now.

  3. IP location databases such as Maxmind, now being suppleanted by IP location services. There are a couple of providers who will sell you an IP address to location map. These are imperfect, but even so, they probably get it right more than 95% of the time. The next wave of this will be online services that use multiple data points, such as wireless LANs in the neighborhood and GPS if available, to provide better precision. An example is Google Geolocation API (currently only available through Google Gears) or SimpleGEO (trying to be a geo-marketplace and not just location lookup).

If you're just starting out, I would suggest just asking the user with an unobtrusive form. It is the simplest solution, it works, and it does not have any dependencies on browsers or 3rd party services.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.