Hidden Google Feature Shows User Location

Adam DuVander, July 27th, 2009

Google CodeYou may already have access to your user’s location and not know it yet. If you use Google’s Ajax API loader to access Maps, Search or Feeds, you’re one line of JavaScript away from knowing the user’s country, city, or even a nearby latitude/longitude point.

The code is described at the bottom of the documentation, almost as an afterthought. However, there is a complete description of the ClientLocation object that contains the data and an example.

It is perhaps easier to use than the 3 IP geolocation methods I described in a previous post. Though, this is a JavaScript-only API, meaning it cannot be accessed server-side.

If you’re worried about sharing your location, privacy should not be more of a concern than usual. Google’s service, like those mentioned in the earlier post, uses your computer’s IP address. The series of four numbers (like 208.75.242.38) is publicly available and usually can only pin-point you at city-level accuracy.

That said, as with other geolocation services there’s certainly some funny stuff possible, but I’m sure you’ll use it for good, right? Right?

Hat tip: Brian Cray

Both comments and pings are currently closed.

4 Responses to “Hidden Google Feature Shows User Location”

July 27th, 2009
at 3:31 am
Comment by: Fresh From Twitter today

[...] ube14ub85cuadf8uc5d0 uc815ub9ac http://bit.ly/1epAD0Hidden Google Feature Shows User Location http://bit.ly/15fnW3is #googling some stuff .. regarding #bing and #yahoo on #google yet thinking #apple should have [...]

July 27th, 2009
at 7:09 am
Comment by: Brian Cray

Thanks for the hat tip ;)

July 27th, 2009
at 11:36 am
Comment by: Marshall Kirkpatrick

Hmmm…good to know. Certainly a good headline :) gotta think about what this means.

August 9th, 2009
at 9:31 am
Comment by: Goran Web

Thank you for the heads up. Gives us the option to track more than before.

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.