Y T Nuke  
Results 1 to 16 of 16
Fluff : A member here recently asked for a geo-redirection script, which redirects the user ...
  1. #1
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Free Geo Redirection Script, Works with Banners and Redirects

    Fluff:
    A member here recently asked for a geo-redirection script, which redirects the user to a different CPA offer based on his country. I was using a similar approach for displaying different banners on a site based on geolocation, so I offered to modify the script for his purpose and give it to him. I also realized that a lot of people suffer with this aspect of Internet Marketing. They either don't know how to, or ignore geo-targeting, so decided to share this simple script here.

    Non-Fluff:
    Geo-targeting can increase your income by monetizing the traffic not meant for your default country.
    We all know that most of the CPA offers are targeted for the USA, and if even 80% of our traffic is from the USA, we'll lose out on the 20% traffic that can easily be monetized with appropriate offers. So, we use geo-targeting to display different offers from country to country.

    What this script does:
    It either displays different CPA offers on a webpage for different countries, or redirects the user to different offers for different countries. All the instructions on how to use it are enclosed in a readme.txt file.

    Download Link:
    Code:
    http://www.mediafire.com/download.php?v2ufzo83vlwchvn


    Virus Scan(0/43):
    Code:
    http://www.virustotal.com/file-scan/report.html?id=f4a7dd9b25e74dd47c75b61289b814975a7af8b7e4154d2ed7e035a8aa8387c6-1326224559
    I tried ending this thread quickly before alcohol got the better of me, so forgive me for being quick.
    I'll probably make a better version of this script as soon as I have the time, and share it here, right now I'm busy with lots of pending work due to exams.
    If you have any questions, please post them in this thread and I will resolve them here, so it can benefit other members as well.
    This service rocks..

  2. The Following 15 Users Say Thank You to Corrupt For This Useful Post:

    djmonster (01-10-2012), eunicemartinez_21 (02-06-2012), Feeder (05-07-2012), ForDummies (01-15-2012), imshinji (02-24-2012), justin (02-06-2012), Kamilion (03-16-2012), Madruga (01-10-2012), ouchthathurts (03-05-2012), Pekton (03-16-2012), redmint32 (01-27-2012), sapo (05-07-2012), SeRf*X (03-16-2012), thesky (02-10-2012), xpleet (05-07-2012)

  3. #2
    Madruga's Avatar
    Madruga is offline Power Member
    Join Date
    Mar 2011
    Location
    Europe
    Posts
    608
    Reputation
    442
    Thanks
    394
    Thanked 793 Times in 313 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects



    I was that member haha =) Really appreciating this, it surely does complete the project I was working on since.. since. I will check it out in a few moments, will let you know if I managed it correctly or not

    Repped + Thx
    "More powerful than the will to win is the courage to begin"

  4. The Following User Says Thank You to Madruga For This Useful Post:

    Corrupt (01-11-2012)

  5. #3
    ForDummies's Avatar
    ForDummies is offline Newbies
    Join Date
    Dec 2009
    Posts
    5
    Reputation
    10
    Thanks
    2
    Thanked 6 Times in 1 Post

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Hey Corrupt,

    For the script to work, you need to remove the tab "\t" that's added to the CountryCode variable returned by the geoip script. Otherwise the string comparison won't work and all traffic will be treated as international.

    This means line 9 of index.php should be:
    Code:
    $CountryCode = geoip_country_code_by_addr($gi, $IP);
    Also, there's a lot of unnecessary whitespace in the index.php file that's caused by putting everything within separate <?php ?> tags. It caused issues on my web server, and I presume it will with other peoples' servers as well. PHP short tags are also used, which are not universally supported.

    I would suggest removing all extraneous <?php ?> tags and using php echo for reproducing plain text.

    Here's my updated index.php code:
    Code:
    <?php
    
    $IP = $_SERVER["REMOTE_ADDR"];
    
    include("geo/geoip.inc");
    
    $gi = geoip_open("geo/GeoIP.dat", GEOIP_MEMORY_CACHE);
    
    $CountryCode = geoip_country_code_by_addr($gi, $IP);
    geoip_close($gi);
    
    // ****DO NOT TOUCH ABOVE THIS LINE.******
    //***Consult the Readme if you aren't sure what you're doing****
    
    if ($CountryCode=="US"){
    
        //US offers go here
        
    }
    
    //Add or remove these else if statements depending on which countries you have offers for
    
        else if($CountryCode=="GB")
        {
            //UK offers go here
        } 
        
        else if($CountryCode=="AU")
        {
            //AU offers go here
        } 
        
        else if($CountryCode=="DE")
        {
            //DE offers go here
        }
    
    else {
    
        //Change this to reflect your international offers for country codes not listed above
        echo 'INTERNATIONAL OFFERS GO HERE';
    }
    
    ?>

  6. The Following 6 Users Say Thank You to ForDummies For This Useful Post:

    Corrupt (01-22-2012), Feeder (05-07-2012), justin (02-06-2012), Madruga (01-24-2012), redmint32 (01-27-2012), xpleet (05-07-2012)

  7. #4
    Madruga's Avatar
    Madruga is offline Power Member
    Join Date
    Mar 2011
    Location
    Europe
    Posts
    608
    Reputation
    442
    Thanks
    394
    Thanked 793 Times in 313 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    I hope this will work too, seems fixed every here and there
    "More powerful than the will to win is the courage to begin"

  8. #5
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    [7:43:11 AM] Corrupt: Thanks for fixing up the \t issue
    [7:43:17 AM] Corrupt: As for the excessive php tags
    [7:43:40 AM] Corrupt: I changed the original script to include more tags to make it easier for the guys to add new offers
    [7:43:57 AM] Corrupt: Otherwise I had it in a compact form on my own installation



    @Madruga,
    If you need any help setting it up, add me on Skype.

  9. The Following User Says Thank You to Corrupt For This Useful Post:

    Madruga (01-24-2012)

  10. #6
    Madruga's Avatar
    Madruga is offline Power Member
    Join Date
    Mar 2011
    Location
    Europe
    Posts
    608
    Reputation
    442
    Thanks
    394
    Thanked 793 Times in 313 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Quote Originally Posted by Corrupt View Post
    [7:43:11 AM] @Madruga,
    If you need any help setting it up, add me on Skype.
    Gathering right now an amount of offers :] Thank you for your help once again.
    "More powerful than the will to win is the courage to begin"

  11. #7
    eunicemartinez_21's Avatar
    eunicemartinez_21 is offline Regular Member
    Join Date
    Oct 2009
    Posts
    327
    Reputation
    26
    Thanks
    108
    Thanked 55 Times in 33 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Hey bro sent you a message... Hope you got it... Thanks

  12. #8
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Quote Originally Posted by eunicemartinez_21 View Post
    Hey bro sent you a message... Hope you got it... Thanks
    Replied

  13. #9
    Ayomav is online now Regular Member
    Join Date
    Nov 2011
    Posts
    249
    Reputation
    27
    Thanks
    114
    Thanked 17 Times in 14 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Quote Originally Posted by ForDummies View Post
    Hey Corrupt,

    For the script to work, you need to remove the tab "\t" that's added to the CountryCode variable returned by the geoip script. Otherwise the string comparison won't work and all traffic will be treated as international.

    This means line 9 of index.php should be:
    Code:
    $CountryCode = geoip_country_code_by_addr($gi, $IP);
    Also, there's a lot of unnecessary whitespace in the index.php file that's caused by putting everything within separate <?php ?> tags. It caused issues on my web server, and I presume it will with other peoples' servers as well. PHP short tags are also used, which are not universally supported.

    I would suggest removing all extraneous <?php ?> tags and using php echo for reproducing plain text.

    Here's my updated index.php code:
    Code:
    <?php
    
    $IP = $_SERVER["REMOTE_ADDR"];
    
    include("geo/geoip.inc");
    
    $gi = geoip_open("geo/GeoIP.dat", GEOIP_MEMORY_CACHE);
    
    $CountryCode = geoip_country_code_by_addr($gi, $IP);
    geoip_close($gi);
    
    // ****DO NOT TOUCH ABOVE THIS LINE.******
    //***Consult the Readme if you aren't sure what you're doing****
    
    if ($CountryCode=="US"){
    
        //US offers go here
        
    }
    
    //Add or remove these else if statements depending on which countries you have offers for
    
        else if($CountryCode=="GB")
        {
            //UK offers go here
        } 
        
        else if($CountryCode=="AU")
        {
            //AU offers go here
        } 
        
        else if($CountryCode=="DE")
        {
            //DE offers go here
        }
    
    else {
    
        //Change this to reflect your international offers for country codes not listed above
        echo 'INTERNATIONAL OFFERS GO HERE';
    }
    
    ?>
    Hello,

    Where it says - US offers goes here.

    Do I need to put it like this

    //<?php header('Location: http://usoffer.com'); ?>

    Or like this

    //http://usoffer.com

    Thanks

  14. #10
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Quote Originally Posted by Ayomav View Post
    Hello,

    Where it says - US offers goes here.

    Do I need to put it like this

    //<?php header('Location: http://usoffer.com'); ?>

    Or like this

    //http://usoffer.com

    Thanks
    The first one is correct, but remove the //
    Put it like:
    <?php header('Location: http://usoffer.com'); ?>

  15. The Following User Says Thank You to Corrupt For This Useful Post:

    Ayomav (03-18-2012)

  16. #11
    Jeffdeaf is offline Newbies
    Join Date
    Jan 2012
    Location
    Holland
    Posts
    7
    Reputation
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    I'm having some trouble getting this to work..

    It's sending all traffic to catchall international offer, even when I defined other country codes, and I also deleted the "|t" argument.

    Somebody help please


    Thank you for the share!

    -edit-
    I would PM you, but I have less then 15 posts....

  17. #12
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Paste your code here in code tags, remove the offer urls though

  18. #13
    Jeffdeaf is offline Newbies
    Join Date
    Jan 2012
    Location
    Holland
    Posts
    7
    Reputation
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    That was fast

    Code:
    <?php
    
    
    $IP = $_SERVER["REMOTE_ADDR"];
    
    
    include("geo/geoip.inc");
    
    
    $gi = geoip_open("geo/GeoIP.dat", GEOIP_MEMORY_CACHE);
    
    
    $CountryCode = geoip_country_code_by_addr($gi, $IP);
    geoip_close($gi);
    
    
    // ****DO NOT TOUCH ABOVE THIS LINE.******
    //***Consult the Readme if you aren't sure what you're doing****
    
    
    if ($CountryCode=="US"){
    
    
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    
    }
    
    
    //Add or remove these else if statements depending on which countries
    
    
    else if($CountryCode=="UK")
    {
    //UK offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    } 
    
        else if($CountryCode=="CA")
    {
    //CA offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    } 
    else if($CountryCode=="AU")
    {
    //AU offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    } 
    
    else if($CountryCode=="DE")
    {
    //DE offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    }
    else if($CountryCode=="IE")
    {
    //IE offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    }
         else if($CountryCode=="NZ")
    {
    //NZ offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    }
         else if($CountryCode=="FR")
    {
    //FR offers go here
    header('Location: /mt/13b4v264b4z213s254w2/'); 
    }
         else if($CountryCode=="BE")
    {
    //BE offers go here
    header('Location: /mt/w2b4333494z213s254w2/'); 
    } 
             else if($CountryCode=="CH")
    {
    //CH offers go here
    header('Location: /mt/033443a464z213s254w2/'); 
    } 
                 else if($CountryCode=="AT")
    {
    //AT offers go here
    header('Location: /mt/03344384f4z213s254w2/'); 
    } 
                     else if($CountryCode=="NL")
    {
    //NL offers go here
    header('Location: /mt/x25423c4e4z213s254w2/'); 
    } 
                         else if($CountryCode=="PL")
    {
    //PL offers go here
    header('Location: /mt/1384138494z213s254w2/'); 
    } 
                             else if($CountryCode=="NO")
    {
    //NO offers go here
    header('Location: /mt/z2a4z254a4z213s254w2/'); 
    } 
        
                             else if($CountryCode=="FI")
    {
    //FI offers go here
    header('Location: /mt/z2a4z254a4z213s254w2/'); 
    } 
                                 else if($CountryCode=="DK")
    {
    //DK offers go here
    header('Location: /mt/z2a4z254a4z213s254w2/'); 
    } 
                                 else if($CountryCode=="SE")
    {
    //SE offers go here
    header('Location: /mt/z2a4z254a4z213s254w2/'); 
    } 
                                     else if($CountryCode=="SA")
    {
    //SE offers go here
    header('Location: /mt/x254333474z213s254w2/'); 
    } 
                                         else if($CountryCode=="IN")
    {
    //SE offers go here
    header('Location: /mt/x25423c4f4z213s254w2/'); 
    } 
    else {
    
    
    //Change this to reflect your international offers for country codes not listed above
    
        
    header('Location: /trafficoptimizer/index.php?toid=70506&amp;r=lc356993'); /* Stuur de browser naar */
    }
    
    
    ?>

  19. #14
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Just to be sure, did you check using proxies?

  20. #15
    Jeffdeaf is offline Newbies
    Join Date
    Jan 2012
    Location
    Holland
    Posts
    7
    Reputation
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    I'm not on proxies but good suggestion

    -edit-

    the other code is not the problem

    the ip's aren't catched and redirected accordingly..
    Last edited by Jeffdeaf; 05-07-2012 at 10:34 PM.

  21. #16
    Corrupt's Avatar
    Corrupt is offline One Man Army
    Join Date
    Sep 2011
    Posts
    746
    Reputation
    285
    Blog Entries
    1
    Thanks
    626
    Thanked 320 Times in 208 Posts

    Default Re: Free Geo Redirection Script, Works with Banners and Redirects

    Quote Originally Posted by Jeffdeaf View Post
    I'm not on proxies but good suggestion

    -edit-

    the other code is not the problem

    the ip's aren't catched and redirected accordingly..
    Did you copy paste all the files properly? Do it again, except the index/redirect.php script. Don't change the directory strucutre.

Natural Slow Link Building


SEO Blasts - High quality link building service

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  SEnukeX SEO Software
Proudly Powered by Hostwinds.com Web Hosting Click Here For Exclusive BHW Discounts!

Cheap Web Hosting


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76