share: redirecting script based on location

4 replies
Many of you know this many do not
Here is a simple java script code for redirecting traffic based on country from landing page (onload) to offer page

Code:
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>


<script language="JavaScript">

var country= geoip_country_code();

if(country  == "US")      
{
<!--
window.location = "http://www.youroffer.com"
//-->
}

else   
{
<!--
window.location = "OTHER OFFER URL"
//-->
}

</script>
#redirecting #script #share
  • Profile picture of the author LukePeerFly
    Nice share. MaxMind's API is great
    Signature

    ^ My Blog

    Are you an affiliate that runs PPV advertising? You need my PPV target scraper!
    Have a Facebook Page? FPTraffic, manages over 1,000,000,000 (BILLION) Likes! Check it out :)
    {{ DiscussionBoard.errors[7789923].message }}
    • Profile picture of the author slowpoison
      Yep completly agree on this, I would recommend any newbies/advanced users to use this as I used to use this a while back, now I dont need this because I already have one on me but this should save newbies some time scouring Google. This is 100% working and a good share for all new warriors you guys should thank him for this
      {{ DiscussionBoard.errors[7790014].message }}
  • Profile picture of the author bizoppmaster
    Yes, this script works every time, thanks!
    Signature
    (4) Spots Left For Private Coaching | TheProfitCoach.com | Skype: jon.mac303
    [URL="http://theprofitcoach.com/facebook/"]
    {{ DiscussionBoard.errors[7790606].message }}
  • Profile picture of the author savechip
    Thanks! Below is for people that want to redirect to other countries & hide referral links as an extra security..

    List of two letter countries
    Hide offer links


    Code:
    <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
    
    
    <script language="JavaScript">
    
    var country= geoip_country_code();
    
    if(country  == "US")      
    {
    window.location = "http://www.blankrefer.com/?http://www.USoffer.com"
    }
    else if(country  == "UK"){
    window.location = "http://www.blankrefer.com/?http://www.UKoffer.com"
    }
    else{
    window.location = "http://www.blankrefer.com/?http://www.AllOthers.com"
    }
    
    </script>
    {{ DiscussionBoard.errors[7836495].message }}

Trending Topics