Need geo targetting advice

Discussion in 'Programming' started by knopix, Oct 24, 2006.

  1. #1
    I'm using the free MaxMind geoip files to do geotargetting on my site
    I do it the easy way by including the geoip.dat and geoip.inc files
    would it be faster if I queried a database instead of the geoip.dat file?

    I can't use the apache module because I'm on a shared host
     
    knopix, Oct 24, 2006 IP
  2. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Typically sending a query to a database would be quicker than using a flat file. Databases are designed to optimise handling and searching large volumes of data which what you need in this instance.

    Having said that however the only way to know for sure is to compare the speed of each method on your server.
     
    streety, Oct 24, 2006 IP
  3. TheGuy

    TheGuy Peon

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I agree with streety. The performance of db with huge tables can be affected. If you decide to use tables, I'd recommend to use Indexes.
     
    TheGuy, Oct 24, 2006 IP
  4. coolsaint

    coolsaint Banned

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think there are ways to get data from a file effeciently.
    even in a shared hosting you can use it. There is no problem at all. You can try this. They update very frequently.

    More info:

    http://weirdsilence.net/software/85/
     
    coolsaint, Oct 27, 2006 IP
  5. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #5
    Barti1987, Oct 30, 2006 IP
  6. ghoti

    ghoti Peon

    Messages:
    139
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I find that it's much, much faster with database queries.

    I just put together a guide for an easy way to do it with Webnet77's IPtoCountry.csv database:
    http://www.ghoti.ca/2006/11/17/ip-to-country-mapping-for-your-traffic/
     
    ghoti, Nov 17, 2006 IP
  7. knopix

    knopix Peon

    Messages:
    122
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks ghoti, as it turns out I'm still looking for a solution so I'll definitely read through your guide

    Is Webnet77's IPtoCountry database accurate? the MaxMind database I was using is 97% accurate
     
    knopix, Nov 17, 2006 IP
  8. sultancillo

    sultancillo Peon

    Messages:
    35
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I've found this *free* ip to country database to be very accurate

    hxxp://ip-to-country.webhosting.info/node/view/6

    it's updated every month, only ip to country information, no city, region or state info though..

    they also have a few examples of code on how use it

    hxxp://ip-to-country.webhosting.info/node/view/118
     
    sultancillo, Nov 17, 2006 IP
  9. ghoti

    ghoti Peon

    Messages:
    139
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I don't have an exact number for how accurate it is, but it has been good enough for me.
     
    ghoti, Nov 17, 2006 IP
  10. TheGuy

    TheGuy Peon

    Messages:
    138
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Good tutorial, but I don't think it is advisable to query db on each page load. You can set a cookie after checking the ip once.
     
    TheGuy, Nov 17, 2006 IP
  11. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hi sultancillo,

    I was just wondering how you have tested the accuracy of the database?
     
    streety, Nov 17, 2006 IP
  12. sultancillo

    sultancillo Peon

    Messages:
    35
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    i have used it on my sites to target affiliate links to the geolocation of visitors... Conversions went up once i started doing geotargetting this way
     
    sultancillo, Nov 17, 2006 IP
  13. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Fair enough, I was hoping you may have done something slightly more robust, although how I have no idea.

    The problem with your approach is that you could probably expect an increase in conversions for a database accuracy level of anything over 50%.
     
    streety, Nov 18, 2006 IP
  14. ghoti

    ghoti Peon

    Messages:
    139
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Good point. :)
    The visitors to the site I'm using it on right now don't really view more than one page, so I hadn't bothered to think that far.


    BTW, I also tried MaxMind's GeoIP database yesterday and that also works well... When I get around to needing city-level geo-targeting (in the next few weeks), maybe I'll put together something similar for GeoIP.
     
    ghoti, Nov 19, 2006 IP
  15. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #15
    I would be wary using city level geolocating. On a country basis these databases are fairly accurate but as the area falls so does the accuracy.

    I move about quite a bit and in my experience (over the past 4 moves/years) the closest they have been able to identify my location from my ip address is a 20 mile radius. At the moment it is probably approximately 400 miles.
     
    streety, Nov 20, 2006 IP