If you want to track visitors to know where they are coming from, the normal un*x’ish way of doing this is to grab maxmind‘s geoiplookup (or apt-get/rpmfind) and then run it against the web server logs. That’s so not Web 2.0. *ugh*
in your web page and voila’, you have the client location. How? If you directly navigate to the jsapi, you’ll see the following:
which pretty much gives you all you need to locate the user. Do a jQuery post to your web server and you know exactly where the user is coming from. Here’s a better example. The map below uses Google’s Map API to show you where you are viewing this blog from.