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

[FREE] GEO IP Redirect and banner rotator script. Good for CPA!

Discussion in 'Making Money' started by Mike420, Sep 13, 2014.

  1. Mike420

    Mike420 Junior Member

    Joined:
    Apr 13, 2013
    Messages:
    139
    Likes Received:
    30
    Hi. I will share two scripts. These are great to monetize cpa offers.
    Scripts will redirect or rotate banner based on your visitor country.

    First script is redirect. It should be placed between <head></head>

    Code:
    <head>
    <script src="//j.maxmind.com/app/country.js" type="text/javascript"></script>
    <script type="text/javascript">
    var country = geoip_country_code();
    if(country==='US'){
      document.location.href = "http://us.com";
    }
    else if(country==='CA'){
       document.location.href = "http://ca.com";
    }
    else if(country==='UK'){
       document.location.href = "http://uk.com";
    }
    else if(country==='AU'){
       document.location.href = "http://au.com";
    }
    
    
    else // if none of the countries above
    {
    document.location.href = "http://other.com";
    }
    </script> 
    </head>
    Second script is banner rotator.

    Code:
    <head><script src="//j.maxmind.com/app/country.js" type="text/javascript"></script></head>
    
    <div id="banner"></div>
    
    <div id="ad" style="display: none;">
    YOUR ADSENSE CODE // This div works when visitor is not from listed countries.
    </div>
    
    <script type="text/javascript">
    var country = geoip_country_code();
    if(country==='US'){
      document.getElementById('banner').innerHTML = '<a href="http://us.com" target="_blank"><img src="http://usa.gif" /></a>';
    }
    else if(country==='CA'){
       document.getElementById('banner').innerHTML = '<a href="http://ca.com" target="_blank"><img src="http://ca.gif" /></a>';
    }
    else if(country==='UK'){
       document.getElementById('banner').innerHTML = '<a href="http://uk.com" target="_blank"><img src="http://uk.gif" /></a>';
    }
    else if(country==='AU'){
       document.getElementById('banner').innerHTML = '<a href="http://au.com" target="_blank"><img src="http://au.gif" /></a>';
    }
    
    else // if none of the countries above
    {
    document.getElementById('ad').style.display='block';
    var theDiv = document.getElementById('banner');
    var content = document.getElementById('ad');
    theDiv.appendChild(content);
    }
    </script> 
    Thats it , i hope these will get u more money :D
     
    • Thanks Thanks x 4
  2. divok

    divok Senior Member

    Joined:
    Jul 21, 2010
    Messages:
    1,067
    Likes Received:
    648
    Location:
    .IN
    Explain these ? Is it yours or some 3rd party .
     
  3. Castiel999

    Castiel999 Junior Member

    Joined:
    Jul 5, 2012
    Messages:
    105
    Likes Received:
    13
    Location:
    Gone with the wind.
    Yup please do answer OP....


    Castiel.
     
    • Thanks Thanks x 1
  4. methodman90

    methodman90 BANNED BANNED

    Joined:
    Oct 10, 2013
    Messages:
    294
    Likes Received:
    140
    Well maxmind.com is just one huge company about geo ip rotation stuff and detect proxy stuff, so it must be a 3rd party unless the op is the owner.. Anyway seem safe, will be testing it tonight.
     
  5. lord1027

    lord1027 Elite Member

    Joined:
    Sep 20, 2013
    Messages:
    3,177
    Likes Received:
    2,239
    I'll wait for a review before I'll test it. Anyway, thanks for the share.
     
  6. ButcherBoy

    ButcherBoy Regular Member

    Joined:
    Apr 3, 2009
    Messages:
    392
    Likes Received:
    80
    Location:
    Planet E.
    Did you try to open maxmind.com and see for yourself?
     
  7. Mike420

    Mike420 Junior Member

    Joined:
    Apr 13, 2013
    Messages:
    139
    Likes Received:
    30
  8. divok

    divok Senior Member

    Joined:
    Jul 21, 2010
    Messages:
    1,067
    Likes Received:
    648
    Location:
    .IN
    yes .
     
  9. bigbroski

    bigbroski Newbie

    Joined:
    Jul 17, 2014
    Messages:
    41
    Likes Received:
    6
    Vouch for legitimacy of maxmind. It is 3rd party, MaxMind is company that provides solutions for geo-location. Great share, used same codes when i needed to filter my traffic to individual CPA offers, because my network didn't had multi-geo option :D
     
  10. 2DHades

    2DHades Power Member

    Joined:
    Feb 8, 2011
    Messages:
    664
    Likes Received:
    324
    Thank you sir! :)
     
  11. nanavlad

    nanavlad Jr. VIP Jr. VIP

    Joined:
    Dec 2, 2009
    Messages:
    2,551
    Likes Received:
    932
    Gender:
    Male
    Occupation:
    SEO Consultant
    Location:
    Proxy Central
  12. ScreamingMidget

    ScreamingMidget Jr. VIP Jr. VIP

    Joined:
    Mar 17, 2013
    Messages:
    950
    Likes Received:
    96
    I've used MaxMind free, which I'm guessing is what the OP is using and I've been disappointed with the accuracy. Has anyone tried the paid version of MaxMind's database and able to compare accuracy?
     
  13. Mike420

    Mike420 Junior Member

    Joined:
    Apr 13, 2013
    Messages:
    139
    Likes Received:
    30
    Works fine with me...
     
  14. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP

    Joined:
    Oct 28, 2011
    Messages:
    3,891
    Likes Received:
    2,149
    Occupation:
    Ninja
  15. stevenman555

    stevenman555 Registered Member

    Joined:
    Sep 15, 2014
    Messages:
    76
    Likes Received:
    6
    How can i use this in wordpress? Please help
     
  16. bugeast

    bugeast Junior Member

    Joined:
    Aug 21, 2015
    Messages:
    148
    Likes Received:
    16
    is this still work sir?