Finding a visitors location and displaying it on the page? (Geo-Targeting)

Discussion in 'HTML & Website Design' started by ClayTrainor, Feb 22, 2008.

  1. #1
    Hi,

    I was wondering if there is a way to find out a visitors location and display something like this on the page.

    "We love customers from Boise, Idaho"

    I was looking into MaxMind's geotargeting databases but, apparently they cause a heavy strain on your server if you get a decent amount of traffic.

    I know this can be done because i've seen it in Adult friend finder ads on various sites.

    Anyways, i was just wondering if anyone could guide me in the right direction, thanks :)
     
    ClayTrainor, Feb 22, 2008 IP
  2. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #2
    every time a visitor downlaods a page, image, anything from your site, they leave a fingerprint. This fingerprint includes the time, IP address of the connection, browser version, operating system version, some software also report their presence as well (typically windows software only).

    There are ways you can use javascript to check the visitors IP and find it's location. Now this isn't their exact location by any means. For me those report me as being in Burlington, and I'm 4 hours away in Kingston. I've never even been to burlington. What a way to leave a bad taste in somebody's mouth by getting it massively wrong.

    You can do this all in javascript, there are millions of tutorials, but I really question the credibility this would add to your site, it doesn't seem to be a good thing in my experience.
     
    innovati, Feb 22, 2008 IP
  3. jamil0458

    jamil0458 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can chieve similar thing with robots text file
     
    jamil0458, Feb 22, 2008 IP
  4. ClayTrainor

    ClayTrainor Peon

    Messages:
    8
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I went and searched for this. I don't exactly see how i can use it to find the location of each visitor.

    Care to elaborate?

    Thanks

    True but, even if i can just get it down to the state / province level, i'd be satisfied.

    Ill take a look into that javascript you mentioned. You ever tried any in particular that worked?
     
    ClayTrainor, Feb 22, 2008 IP
  5. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #5
    I don't see how that's even possible. That would be like saying you could tell the web masters name by the colour of the logo on their frontpage.

    The only thing that gives away the (near)location of a visitor to a site is the IP.
     
    innovati, Feb 22, 2008 IP
  6. ClayTrainor

    ClayTrainor Peon

    Messages:
    8
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That javascript you were talking about, do you have any more info? I can't seem to find any scripts that deal with ip's at all.
     
    ClayTrainor, Feb 22, 2008 IP
  7. iamben

    iamben Active Member

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    73
    #7
    I'm pretty sure when you get down further than the country, the IP relates to the location of the ISP. Whilst that may be fine statewise in the US or Canada, it's pretty useless in the UK- I mean, I've seen the adult ads that say 'girls in wherever' - which is usually miles and miles away from where I live. So pretty pointless. I'm almost certain you'd get a higher CTR by just saying 'girls in the UK'.

    Similarly, it's worth thinking about what your customer might think if you welcome them from a location they're not at - it doesn't exactly say 'reliable'.

    Also, I geotarget almost all my sites by country - it's a pretty hefty database (which isn't always 100% correct) - I can only imagine going in further, to towns and whatever, the DB would be massive.
     
    iamben, Feb 23, 2008 IP
  8. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #8
    yeah, it targets a town that's 4 hours from me, a nasty place I wouldn't ever want to go. Imagine going to all of these sites that have ads that say: sexy girls in burlington! on a sign. Like I really care. Not only do I *know* they're not from burlington, but I don't care if they are in burlington cause it's nasty.

    Now Iamben had a better solution, localize only to the national level. If it said: girls from canada! I might have thought: oh, they knew I was from canada, so they targeted canadian only ads. but I wouldn't think that it was the ad targeting it necessarily.
     
    innovati, Feb 23, 2008 IP
  9. Johnny10g

    Johnny10g Guest

    Messages:
    6
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    IP is the way to go...but it's not a easy thing to do.

    I implemented a custom Geo-IP function on my site last year, simply to figure out which country each visitor was based in (its very relevant to the service I provide). I only wanted to figure out whether my visitor was from US, UK, Canada, Australia or New Zealand. How hard could that be?

    After downloading a free IP database (sorry, haven't got the details handy but hey, Google is your friend) I found the IP address ranges weren't arranged in nice neat blocks like I'd imagined - they literally fragment all over the place.

    There were thousands of different IP ranges in no sensible sequence whatsoever. Eventually, I did manage to put together a solution - but even then I need to cheat a little, figuring out the UK/Canada/Oz/NZ visitors by checking against 13,000 IP ranges, and simply assuming US for the rest.

    Bear in mind this was just narrowing it down to 5 countries - like iamben says, the town-based IP ranges means, potentially, a lot more data. FWIW, my solution is server-based - no way would I attempt it in Javascript...
     
    Johnny10g, Feb 23, 2008 IP
  10. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #10

    You can use the IP2Country database and read/display with a simple PHP call.
     
    LittleJonSupportSite, Feb 23, 2008 IP
  11. vishnups

    vishnups Banned

    Messages:
    166
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #11
    It can be done using PHP and PEAR Net:Geo. You can contact me if you are interested for a small fee.
     
    vishnups, Feb 23, 2008 IP
  12. ClayTrainor

    ClayTrainor Peon

    Messages:
    8
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12

    Haha dude, im living like 2 minutes away from burlington right now.

    It's not so bad... okay i lie... it smells and theres bums everywhere, lol.
     
    ClayTrainor, Feb 24, 2008 IP
  13. popnyc

    popnyc Active Member

    Messages:
    1,391
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #13
    I found http://ip2nation.com/ to geotarget by country.

    Not sure the details on how to use it.

    Where do I install this script onto my webpage?

    It has script lines by country, not sure how to use it. Where do I insert the affiliate code? Each country
    has a different URL.

    INSERT INTO ip2nation (ip, country) VALUES(0, 'us');
    INSERT INTO ip2nation (ip, country) VALUES(2540240896, 'fi');
     
    popnyc, May 4, 2008 IP