Ad choice dependent on vistors location

Is it possible to code on our website an area that automatically shows adverts dependent on the visitors location, either postcode or city?

These adverts would be our own adverts, and would only show our adverts. But would highlight different distributors dependent on their location.

Example
Visitor from London – sees one of our London distributors, visitor from Manchester one of our Manchester ones.

Certainly. You need to get a GeoIP database, like MaxMind’s City Database and then when a visitor enters your site check their IP against that database and act accordingly.

I have tested something like that before, but my IP address results are about 100 miles out (UK based).Is there anything that picks up the users details like city etc??

Unfortunately, any results you get from geo-coding are not going to be accurate enough for what you want to achieve. For example, using the MaxMind database, my own company IP address shows up as a city that is at least 700 km from where we are based. That’s not surprising, since the IP address is really that of the ISP, not of my own company.

The best you can do is to target the country, not the city or region within the county. At least, that’s true of the UK. I think the results might be more accurate in the US. I just tried one of my American clients’ IP, and the city that it reports is close to their actual location. But you’ll need to test that for yourself.

Mike