WEB How do I control ads based on visitors?

Discussion in 'OT Technology' started by Ebtek, Mar 21, 2009.

  1. Ebtek

    Ebtek Afraid of 138

    Joined:
    Mar 19, 2000
    Messages:
    152,960
    Likes Received:
    1,100
    Wirelessly posted via wap.offtopic.com (pozcumlubedberry 9000: Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.13057/786; U; en) Presto/2.2.0)

    I'm in canada and like 75% of visitors on my site are from canada but I'm running a few us-only mb ads. I got 30 clicks on this auto insurance quote one that pays like $10.

    Can I have a canadian friendly on presented if the visitor is from canada?
     
  2. Zephyr

    Zephyr New Member

    Joined:
    Jul 30, 2007
    Messages:
    9,557
    Likes Received:
    0
    Location:
    Ahnold Land
    proxy cloak? so the guy goes to the proxy site based on US, directed to your affiliate link, and bam?
     
  3. Ebtek

    Ebtek Afraid of 138

    Joined:
    Mar 19, 2000
    Messages:
    152,960
    Likes Received:
    1,100
    Wirelessly posted via wap.offtopic.com (pozcumlubedberry 9000: Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.13057/786; U; en) Presto/2.2.0)

    Omg :bowdown:

    At first I was like I need to find a canadian campaign that's the same topic as the american one, but this is fucking genious

    Where can I get the code for this?
     
  4. Zephyr

    Zephyr New Member

    Joined:
    Jul 30, 2007
    Messages:
    9,557
    Likes Received:
    0
    Location:
    Ahnold Land
    im not entirely sure about how it works but someone here does. :dunno: sorry
     
  5. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    Look at geo-targeting. Tons of libraries out there based on visitor IP
     
  6. 07

    07 18-1

    Joined:
    Jun 26, 2006
    Messages:
    4,933
    Likes Received:
    0
    dot.

    I have geo-targetting set up with some sites. If I was home, I would give you the link...
     
  7. Ebtek

    Ebtek Afraid of 138

    Joined:
    Mar 19, 2000
    Messages:
    152,960
    Likes Received:
    1,100
    Wirelessly posted via wap.offtopic.com (pozcumlubedberry 9000: Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.13057/786; U; en) Presto/2.2.0)

    Awesome. Update this thread when you can bro
     
  8. fl0rine2

    fl0rine2 New Member

    Joined:
    Jan 6, 2005
    Messages:
    1,824
    Likes Received:
    0
    In the past I've used the api from hostip.info. Here's an example of the api usage: http://api.hostip.info/get_html.php?ip=12.215.42.19

    And here's the code I did for it:
    Code:
    $ip=$_SERVER['REMOTE_ADDR'];
    $url = "http://api.hostip.info/get_html.php?ip=".$ip;
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11");
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
    curl_setopt($ch, CURLOPT_REFERER, $ref);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $results = curl_exec($ch);
    curl_close($ch);
    $pattern = '/us/i';
    $country = preg_match($pattern, $results);
    The above will match for US visitors so change the regex in $pattern to whatever country you like
     
  9. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden

    Why not use the code directly instead of having to look up on a 3rd party...

    http://www.maxmind.com/app/php
    http://geolite.maxmind.com/download/geoip/api/php/
     
  10. 07

    07 18-1

    Joined:
    Jun 26, 2006
    Messages:
    4,933
    Likes Received:
    0
  11. Gort

    Gort OT Supporter

    Joined:
    Jul 6, 2006
    Messages:
    13,657
    Likes Received:
    8
    Location:
    Over the Rainbow
    Fuck all that shit and get the hosted OpenX adserving service.

    http://openx.org
     

Share This Page