Comments(0) » | Add Comment » | Permalink » | Blog Home Page » Blog Post

Posted: 2006-12-29 14:13:18
Tags: technical   perl   javascript   api   google   programming  
Geolocating the site's visitors

I'll admit , it became a bit of an obsession to see where my visitors were coming from to this new site. So I set out on what turned out to be a bit of an arduous journey to locate a database/web services that will geolocate my visitor's IP address. I initially started off in a state of  disbelief when I found out that there are vendors out there actually selling this data for insane amount of money (upwards of thousands). I also looked at http://www.hostip.info/, but their web service just wasn't all that reliable .

Enter: maxmind, even though they are a commercial entity, they were generous enough to make a lite version of their GeoIP City database freely available.  As per what they said about it:

Approximately 97% on a country level and 60% on a city level for the US within a 25 mile radius.

They have APIs for various languages, I used the one for Perl (you must compile and install a native C library for the perl module to work with that).  I was really impressed by the performance. Now armed with the all the city, country, long/lat coordinates of my visitor's IP addresses (or atleast 97% of them) here's a final product of it using Google Maps that shows geolocations of my site's recent visitors. Click here.

Cheers!
 

Comments

No comments posted for this post

Comment Form

Name: (Required)
Email:
Website:
Captcha Text: (Required)
Your Comments: (Required)
Try Me