View Single Post
  #1 (permalink)  
Old 02-15-2008, 01:01 PM
bigkee42's Avatar
bigkee42 bigkee42 is offline
Junior Member
 
Join Date: Dec 2007
Location: North Dakota
Posts: 161
Thanks: 44
Thanked 159 Times in 21 Posts
Reputation: 17
iTrader: (5)
Talking Handy Affiliate Cloaking Script Help

Hello,

I am kind of new to the forum and PHP. I found a neat script, but I can not get it to work. I will add the whole blog below:



Affiliate link cloaking with Geo targeting

If you have some experience in affiliate marketing you know why is so important to cloak mask your affiliate links from bots and humans. If not you can find some info here.

Another problem you can face is losing some of your visitors because some of affiliate networks do not allowed traffic from some countries and redirect to different offer without your affiliate ID, so you won’t get your commission. Or you want to redirect user to different landing page/offer depend on region he came from using the same link.

To solve both of this problems I’ve wrote redirect script with geo targeting and it’s time to release it to public.

Configuration:
In config.inc.php you have to define rules and your affiliate links. There is two type of rules.

GEO regular expressions:

* Redirect to destination URL if user came from following countries: ‘/[(US|CA|GB)]/’
* Redirect to destination URL if user not came from following countries: ‘/[^(US|CA)]/’

Static links: linkffer1, linkffer2, etc.
Empty rule: default URL if none of rules above matched
config.inc.php:

<?php
$config = array(
'geo:/[(US|CA)]/' => 'http://example.com/aff-offer1',
'linkffer1' => 'http://example.com/aff-offer2',
'linkffer2' => 'http://example.com/aff-offer3',
'' => 'http://example.com/def-offer', # default offer
);
?>

In your httpd config file/.htaccess add following lines:

RewriteEngine On
RewriteRule ^/r/(.*?)/?$ /redirect.php?link=$1 [QSA,L]

In your robots.txt you disallow redirect script /r/:

User-agent: *
Disallow: /r/

Available country codes:

“AP”, “EU”, “AD”, “AE”, “AF”, “AG”, “AI”, “AL”, “AM”, “AN”, “AO”, “AQ”,
“AR”, “AS”, “AT”, “AU”, “AW”, “AZ”, “BA”, “BB”, “BD”, “BE”, “BF”, “BG”, “BH”,
“BI”, “BJ”, “BM”, “BN”, “BO”, “BR”, “BS”, “BT”, “BV”, “BW”, “BY”, “BZ”, “CA”,
“CC”, “CD”, “CF”, “CG”, “CH”, “CI”, “CK”, “CL”, “CM”, “CN”, “CO”, “CR”, “CU”,
“CV”, “CX”, “CY”, “CZ”, “DE”, “DJ”, “DK”, “DM”, “DO”, “DZ”, “EC”, “EE”, “EG”,
“EH”, “ER”, “ES”, “ET”, “FI”, “FJ”, “FK”, “FM”, “FO”, “FR”, “FX”, “GA”, “GB”,
“GD”, “GE”, “GF”, “GH”, “GI”, “GL”, “GM”, “GN”, “GP”, “GQ”, “GR”, “GS”, “GT”,
“GU”, “GW”, “GY”, “HK”, “HM”, “HN”, “HR”, “HT”, “HU”, “ID”, “IE”, “IL”, “IN”,
“IO”, “IQ”, “IR”, “IS”, “IT”, “JM”, “JO”, “JP”, “KE”, “KG”, “KH”, “KI”, “KM”,
“KN”, “KP”, “KR”, “KW”, “KY”, “KZ”, “LA”, “LB”, “LC”, “LI”, “LK”, “LR”, “LS”,
“LT”, “LU”, “LV”, “LY”, “MA”, “MC”, “MD”, “MG”, “MH”, “MK”, “ML”, “MM”, “MN”,
“MO”, “MP”, “MQ”, “MR”, “MS”, “MT”, “MU”, “MV”, “MW”, “MX”, “MY”, “MZ”, “NA”,
“NC”, “NE”, “NF”, “NG”, “NI”, “NL”, “NO”, “NP”, “NR”, “NU”, “NZ”, “OM”, “PA”,
“PE”, “PF”, “PG”, “PH”, “PK”, “PL”, “PM”, “PN”, “PR”, “PS”, “PT”, “PW”, “PY”,
“QA”, “RE”, “RO”, “RU”, “RW”, “SA”, “SB”, “SC”, “SD”, “SE”, “SG”, “SH”, “SI”,
“SJ”, “SK”, “SL”, “SM”, “SN”, “SO”, “SR”, “ST”, “SV”, “SY”, “SZ”, “TC”, “TD”,
“TF”, “TG”, “TH”, “TJ”, “TK”, “TM”, “TN”, “TO”, “TP”, “TR”, “TT”, “TV”, “TW”,
“TZ”, “UA”, “UG”, “UM”, “US”, “UY”, “UZ”, “VA”, “VC”, “VE”, “VG”, “VI”, “VN”,
“VU”, “WF”, “WS”, “YE”, “YT”, “YU”, “ZA”, “ZM”, “ZR”, “ZW”, “A1″, “A2″, “O1″



I uploaded the information to my domain, but I am not sure what I need to edit to make it work??? Also, I am not sure if I need to change any of the files CHMOD??? Please help
Reply With Quote