1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

geo targeting your offers

Discussion in 'CPA' started by Mondlicht, Jun 11, 2009.

  1. Mondlicht

    Mondlicht Junior Member

    Joined:
    May 14, 2009
    Messages:
    166
    Likes Received:
    63
    Location:
    UK or GER
    Code:
    
    <?php
    
    $country = file_get_contents('http://api.hostip.info/country.php?ip='.$_SERVER['REMOTE_ADDR'];
    
    switch ($country)
        {
        case "UK":
            header('Location: http://www.example.com/');
            break;
        case "US":
            header('Location: http://www.example.com/');
            break;
        default:
            header('Location: http://www.example.com/');
            break;        
    
    ?>
    
    ok the code above will adjust your framed offers depending on the users' country.

    so just get your offers ready iframed with cakeslice and refer blank and
    the header location in each case adjusted to the right redirect-blank iframe page. and you should get going.

    use the default one for those you didn't set up or maybe an error page.

    extend the script with other cities using

    hxxp://api.hostip.info/country.php ( use for example other country proxy's and it should tell you the correct form on the page.

    so just add another

    Code:
        case "XX":
            header('Location: http://www.example.com/');
            break;
    and you're done
     
    • Thanks Thanks x 1