How to redirect users to an offer according to their country.
2015-03-23, 09:43 PM,
#1
Say I want to redirect Frenchies to an offer from network #1 and US citizens to an offer from network #2. How can I do this?

[Image: R5I6Tcg.gif]
Reply
Share This Thread :

2015-03-23, 10:06 PM,
#2
You can use

Code:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', '//ipinfo.io', true);
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        if(xmlhttp.status == 200) {
            var obj = JSON.parse(xmlhttp.responseText);
            if (obj.country == 'FR')
                window.location.replace('OFFER FOR N#1');
             if (obj.country == 'US')
                window.location.replace('OFFER FOR N#2');
         }
    }
};
xmlhttp.send(null);

Note that you are using ipinfo.io data, if the site goes down, the script goes down, there's a lot of javascript libs for this, but the code above is the quickest, in my opinion.

Other option, may be faster....

Code:
<script language="Javascript" src="http://gd.geobytes.com/Gd?after=-1"></script>
    <script language="javascript">
var finded = false,
    redirections = {
        UK: 'http://www.adworkmedia.com/.....',
        US: 'http://www.cpagrip.com....',
        CA: 'French.htm',   // Canada
        CH: 'Chinese.htm'   // China
    };
//* Checking location code
if(typeof(sGeobytesLocationCode) != "undefined")
{
    var sCountryCode = sGeobytesLocationCode.substring(0,2);
    for(var i in redirections) {
        if(i == sCountryCode) {
            document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=" + redirections[i] + "'>");
            finded = true;
        }
    }
}
//* location code not finded - redirect to default page
if(!finded) {
    document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=World.htm'>");
}
    </script>
Reply
2015-03-23, 10:42 PM,
#3
(2015-03-23, 10:06 PM)Imfc Wrote: You can use

Code:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', '//ipinfo.io', true);
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        if(xmlhttp.status == 200) {
            var obj = JSON.parse(xmlhttp.responseText);
            if (obj.country == 'FR')
                window.location.replace('OFFER FOR N#1');
             if (obj.country == 'US')
                window.location.replace('OFFER FOR N#2');
         }
    }
};
xmlhttp.send(null);

Note that you are using ipinfo.io data, if the site goes down, the script goes down, there's a lot of javascript libs for this, but the code above is the quickest, in my opinion.

Other option, may be faster....

Code:
<script language="Javascript" src="/Gd?after=-1"></script>
    <script language="javascript">
var finded = false,
    redirections = {
        UK: '/.....',
        US: '....',
        CA: 'French.htm',   // Canada
        CH: 'Chinese.htm'   // China
    };
//* Checking location code
if(typeof(sGeobytesLocationCode) != "undefined")
{
    var sCountryCode = sGeobytesLocationCode.substring(0,2);
    for(var i in redirections) {
        if(i == sCountryCode) {
            document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=" + redirections[i] + "'>");
            finded = true;
        }
    }
}
//* location code not finded - redirect to default page
if(!finded) {
    document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=World.htm'>");
}
    </script>
Sweet! Thank you! :D

[Image: R5I6Tcg.gif]
Reply
2015-03-23, 11:55 PM,
#4
Thanks for that +3 rep
Reply
2015-03-24, 01:19 AM,
#5
(2015-03-23, 11:55 PM)DaveNL Wrote: Thanks for that +3 rep

Hm , thanks daveNL!
Reply
2015-03-24, 03:00 AM, (This post was last modified: 2015-03-24, 03:05 AM by drone43.)
#6
Thanks Imfc for the code . Suppose I want to send french , netherland to cpa ( for example cpagrip) and remaining to pay per instal( example amonetize : it uses javascript code for download link) . I provide 1 download button in my website. People have to click download link and then they will be redirected to offer/network based on country . How redirection is done in this case ? I'll be very helpful if you can help me with this implementation. Thanks for help in advance

Start earning bitcoin using cryptotab visit this link . Upto 10 level of referal earnings
Reply
2015-03-24, 03:40 AM,
#7
one word "prosper202"
Reply
2015-03-24, 10:25 AM,
#8
Some of these scripts do not work on certain browsers, is there a script that works on the big 3? That is Chrome, firefox and Internet Explorer.
Reply
2015-03-25, 02:50 AM,
#9
Anyone with a script that sends US, Uk and Can nationals to 1 offer and the rest of the word to another offer?
Reply


Related Threads
Thread Author Replies Views Last Post
  Best movie streaming offer ruskiczoug 9 373 2018-07-18, 08:13 PM
Last Post: yassiyoh
  Button Install to offer?? wxp100 0 85 2018-07-07, 11:24 PM
Last Post: wxp100
  How Does Duplicate Offer Completion On Different Networks Works? TyrantBoy 2 132 2018-06-21, 04:55 PM
Last Post: IM2020
  Google Adword Campaign Setup for CPA offer dynamo4u 7 428 2018-06-18, 02:26 PM
Last Post: Armin80
  Is there a way to know which Instagram users completed the offer? 5light 8 334 2018-06-10, 04:17 PM
Last Post: CharlieHarper





About Us | Contact Us | CPA Elites | Advertise | Stats

© 2013-2018 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top