Display Your Visitors Location using Google Maps

If you have ever seen a map on a web site showing your location then you know what we are trying to achieve here. One of the easiest ways to do this is to use a data file provided by maxmind to look up the users IP address or a domain name / IP address the visitor entered, I will first explain the steps we need to take and the tools we will need and then a walkthrough of how to put it all together.

What you will need.

Geo Coding for Specific Landing Pages

I was asked yesterday by a website owner if it would be possible to discover where his users were coming from using IP addresses and redirect or show them different content accordingly. I remembered that I had accomplished a similar task only a few months ago using Maxminds geo locating data file to overlay on Google maps showing the location of peoples IP addres and providing reverse look ups of hostnames etc.

Note: if anyone would like this script just leave a comment and I will try and dig it out.