Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently using Google Analytics. I'm trying to find out if it's possible to get the zip codes of those visiting my website. The Cities seem to be too broad.

For example, Los Angeles is huge and has several zip codes. Is it possible to narrow the users location to a zip code?

Many thanks.


share|improve this question

migrated from stackoverflow.com Jan 26 '11 at 10:47

This question came from our site for professional and enthusiast programmers.

And their mailing address too? – EnabrenTane Jan 26 '11 at 0:15
Nope! Just the Zip! – Erik Jan 26 '11 at 0:15

No, this is not possible, unless you get it from the user from for instance a form and put it in a custom variable...but I'm pretty sure recording that information is against Google's privacy policy.

share|improve this answer

Actually, it should be possible.

While I haven't tried this myself, you can get latitude and longitude information via the GA API:


I'm guessing that there are tools that can translate from Long / Lat to zip.

share|improve this answer

You better bet is to use a geo location service or database, like www.ip2location.com or simplegeo.com. You'll need to keep track of it yourself, possibly sending it to Google Analytics. Unfortunately, it still won't give you an exact zip or postal code.

share|improve this answer
+1 for an alternative, but I still wanted to make clear with Erik that one of the main point of GA is to give lots of data without revealing the identity of a user. – Dominique Jan 26 '11 at 20:11

While this may not be possible with Google Analytics, you could probably build a custom tool with MaxMind GeoIP City Database which can "determine country, state/region, city, US postal code, US area code, metro code, latitude, and longitude information for IP addresses worldwide".

With their online demo tool you can perform 25 demo lookups per day to get zip codes for IP addresses of visitors (doesn't work in all cases).

This can be a little scary if someone is trying the tool out (snooping) with your IP address.

share|improve this answer

Your Answer


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