Geographically Targeting Users

Last week I was working on a site where the client wanted to have the option of targeting content by the user's location around the world. At first I panicked as I'd never done anything of the sort before! But after a brief chat with a friend and a few searches, I came across IP2Country Mapping Database which comes with 2 database tables, one with literally thousands of records covering the IPs used around the world, plus a country database which the IPs are mapped to, giving both the country and the region.

After finally getting the tables online (the IP one kept timing out so had to be entered in 3000 records at a time!), I tidied up the regions under the country table. Unfortunately they hadn't been set up exceptionally well, putting Iceland under the Arctic (I know it's north, but it's north Europe!), and some countries under 'The World' which wasn't helpful! However I narrowed the regions down to just 10 which was perfect.

This now allows the client to target certain content (in this case, advertising) to a selection of one or more regions. Perfect to create a more efficient advertising service. Afterall, there's no point advertising to the world when the advert is only ideal for one particular region.

The database is updated monthly and costs less than $15/£7.50 a month for upgrades. The site even gives you the PHP and ASP code you need to convert an IP address to an IP number and determine the country or region from it.

There is a free demo version that you can download and try out too, however this was last updated in 2003.

One Response to “Geographically Targeting Users”

  1. Thanks for the handy tip. I've been looking for something like that for my own use.

    By Anon on Sun, 9 March, 2008

Leave a Comment

Please use your real name or nickname. Spam names will be changed.