Need help: how to geo target advert based on country?

Discussion in 'PHP' started by saturn100, Jan 19, 2012.

  1. #1
    I am looking to geo tarhet a link on a site
    Basically if someone visits the site from US I want it to load the US amazon link
    If some one vists from UK the amazon uk one

    Its a image link and default will be US

    any idea
     
    saturn100, Jan 19, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Yup, use the user language, most handy to use or try to fetch more information about the ip adres and trace the country.. there are alot of free api's to do that!
     
    EricBruggema, Jan 19, 2012 IP
  3. mallorcahp

    mallorcahp Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    IP Address is the way to go ...

    Searched for "free ip address location api" and this looks like it might be of use: ipinfodb.com/ip_location_api.php but not sure how accurate ...
     
    mallorcahp, Jan 21, 2012 IP
  4. trtrtrtr

    trtrtrtr Greenhorn

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    I think you need IP2Country database and a script that convert the client ip address to the country , you can find free database on the net
     
    trtrtrtr, Jan 21, 2012 IP
  5. bluebenz

    bluebenz Well-Known Member

    Messages:
    876
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    138
    #5
    I use IP2location to get visitor country.. but to use it on site, it's a paid service.
     
    bluebenz, Jan 22, 2012 IP
  6. chanif.alfath

    chanif.alfath Active Member

    Messages:
    148
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    88
    #6
    i use geo api to get visitor country, and use it to redirect the visitor to the specific page :D
    ans it's free too :)
     
    chanif.alfath, Jan 22, 2012 IP
  7. Estevan

    Estevan Peon

    Messages:
    120
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    0
    #7
    hello

    the easy way is use javascript api from maxmind

    <script language="JavaScript" src="http://j.maxmind.com/app/country.js"></script>
    <script language="JavaScript">
    var uc=geoip_country_code();
    if(uc=="US"){
    document.write("html us here code here");
    }else{
    document.write("html no us here code here");
    }
    </script>



    best
     
    Estevan, Jan 22, 2012 IP