:: Geocoding Website Visitors
A while back I explored various articles and sites on Google Maps, Website Geocoding, Website Geolocating, and more of the same. The idea has always been in the back of my mind since my days working at Focus (see Work History), where we worked on a lengthy project called WebEnforcer, a web-based mapping application.
WebEnforcer (also had WebResponder and WebProperties) was a web application designed to assist law enforcement officials to respond daily to crime issues. Although it relied on AutoDesk's AutoCad for displaying custom maps, it contained features for selecting parcels of land, radial selections from a given latitude / longitude, etc. It was very exciting to work on, and I always thought I would like to play around with that type of technology again.
So here we are in the age of Google and its highly regarded Google Maps
,
so of course I've been thinking about playing around with APIs and what-not. Then I came across an article at
vega.rd.no
that described how he displayed his website visitors in a Google Map. The idea intrigued me and I set out to do it myself, of course
making some modifications along the way.
Eventually I'll put up an article describing what I did, and the code so you can do it too; but, for now you'll have to settle on just seeing it in action. Currently my steps are:
- Log all of the webserver request in a specially formatted apache log file, ready for MySql.
- Import my Apache Logs into MySQL every 10 minutes. Ideally this would be [near] real-time, but I haven't gotten around to tackling that. So if "you" don't show up, try again in a little bit. (Update: I currently do not import the log file any more as there is a bunch of data for testing.)
- Parse any new or unknown visitor IP Addresses and attempt to determine the City, Country, Latitude, and Longitude.
- When you view the Geocoded Website Visitors, it requests the geo information from MySql and plots it on a Google Map using JavaScript and the Google Maps API.
Also, I'm still working out bugs and trying some new features, but please give it a try, and let me know what you think.

