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

GeoIp Script for FB Iframe CPA Offers?

Discussion in 'FaceBook' started by mmichael, Aug 23, 2011.

  1. mmichael

    mmichael Junior Member

    Joined:
    Mar 26, 2010
    Messages:
    186
    Likes Received:
    77
    Location:
    127.0.0.1
    Does anyone know of if it is possible to host a geoip script through your iframed FB app on a facebook page?

    My problem is that the traffic I am getting is from many countries. I have a US hosted only offer listed since it pays the most, but I am missing out on LOTS of international traffic.

    I am using a wordpress plugin to pull in a wordpress landing page to Facebook.

    Is there a script or plugin that anyone knows of that could rotate that page/post base on country? Even possible?

    Thanks
     
  2. walandio

    walandio Senior Member

    Joined:
    Jun 27, 2008
    Messages:
    1,198
    Likes Received:
    684
    Location:
    Pilipinas
    I badly need this too.. hope someone will post there script here..
     
  3. mmichael

    mmichael Junior Member

    Joined:
    Mar 26, 2010
    Messages:
    186
    Likes Received:
    77
    Location:
    127.0.0.1
    I have found a few scripts that could be pieced together that can use 301 redirects based on country ip... but would like to know if there is something already out there or an easier solution.
     
  4. Gradimir Stankovic

    Gradimir Stankovic Power Member

    Joined:
    Jan 10, 2010
    Messages:
    737
    Likes Received:
    845
    Location:
    404 not found
    Code:
    <head>
    <script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
    <script type="text/javascript">
        switch(geoplugin_countryCode()){
            case "US" :
                document.location.href = "http://url1.com";
                break;
            case "CA" :
                document.location.href = "http://url2.com"
                break;
            default :
                document.location.href = "http://url3.com"
                break;
        }
    </script>
     
    • Thanks Thanks x 2
    Last edited: Aug 23, 2011
  5. mmichael

    mmichael Junior Member

    Joined:
    Mar 26, 2010
    Messages:
    186
    Likes Received:
    77
    Location:
    127.0.0.1
    You sir are the man!
     
  6. balexander26

    balexander26 Newbie

    Joined:
    Oct 3, 2011
    Messages:
    26
    Likes Received:
    4
    I am using something similar to this and would also like to redirect users of other countries to different places. So, in the script below this function is for "United States".

    So if I wanted to direct users from Canada to a different page would I use "Canada" or "CA" or what code/phrase?

    I am wanting to do make numerous functions with numerous countries so if someone could direct me somewhere that explains the codes or phrases to use I would appreciate it.

    I'm new to Javascript so please forgive the noobish question.

    Code:
    if (geoip_country_name()=='[B]United States[/B]') 
    I found a thread by nesterdwarf that started on 1/6/11 titled CPA Redirector 2.1 Modded (can't post links yet), but I don't think it's quite what I'm looking for...is it?