Maxmind Geoip City

anoko

New member
Aug 10, 2007
530
5
0
Anyone here using Maxmind Geoip City (only sold to businesses) to segment traffic or determine location by city?

Post sample php code used to access the maxmind database from your own server if you know how. Thnx!

Here's an incentive..
qgibpkahlkfc_brittany.jpg


hyghhwoqagnd_065.jpg
 


You put that somewhere on your page:

<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>

Then where you want to show the city, you add this:

No Cost for <script language="JavaScript">document.write(geoip_city());</script> Residents

If you want more options with the API, I definitely suggest you have a good look to it but at least you now know how it works.
 
thnx numerouno...that's what I use now but I have geoip_city monthly updates. Will look into the API as you guys suggested.

Additionally, I think you guys are referring to the Maxmind webservice stuff. I am talking about the GeoIPCity.dat and GeoIPOrg.dat that are only provided to businesses.

Just need to access the data from those files :)
 
thnx numerouno...that's what I use now but I have geoip_city monthly updates. Will look into the API as you guys suggested.

Additionally, I think you guys are referring to the Maxmind webservice stuff. I am talking about the GeoIPCity.dat and GeoIPOrg.dat that are only provided to businesses.

Just need to access the data from those files :)
Not sure what your getting at with 'only provied to businesses', but everything you need to get going is on this page: MaxMind - GeoIP PHP API
 
Not sure what your getting at with 'only provied to businesses', but everything you need to get going is on this page: MaxMind - GeoIP PHP API

If you purchase the database, MaxMind asks how you plan to use it - that may be what he is referring to.

That said, even the professional version of MaxMind's city database is only 83% accurate. Are there any alternatives out there?
 
You put that somewhere on your page:

<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>

Then where you want to show the city, you add this:

No Cost for <script language="JavaScript">document.write(geoip_city());</script> Residents

If you want more options with the API, I definitely suggest you have a good look to it but at least you now know how it works.

Maxmind are great and that code above will do the the job for inserting the city - I'd recommend you do City only and not State as well for outside USA or it'll product strange results, e.g. where I am my state appears as E7 which is completely wrong.

For geo redirects and segmenting users based on country I'd recommend using maxmind web queries for a faster redirect time.

Another option is to install their db on your server.
 
I'd like to see one that references the largest city near to the IP, rather than each podunk town. People respond better to pages targeted near them, but it loses credibility when all these hot, single moms in Podunkville, Alabama are making money using them internets.
 
I'd like to see one that references the largest city near to the IP, rather than each podunk town. People respond better to pages targeted near them, but it loses credibility when all these hot, single moms in Podunkville, Alabama are making money using them internets.
The only way I can think of of fixing that is by using lots of if then statements that match cities with smaller populations :/.
 
I wrote a script and combined/pruned the major databases and cross referenced with logs from some of my landers. Costs $20 tho, check my sig.

/shamelessplug