Log in

View Full Version : Any way to filter out Geo specific traffic


NY Jester
2008-01-23, 09:29 AM
I was just wondering and Im sure theres a way..just beyond my scope of knowledge. How can I filter out GEO specific traffic...or have my site handle them different. .htaccess? or something else?

Thanks


***

msanchez
2008-01-25, 12:54 PM
AFAIK it can be done with htaccess, but the problem is that the IPs for each country are always changing so its a real pain to keep it up to date.

There are services that provide this for a fee, but I haven't tried any myself.

deejne
2008-01-25, 10:35 PM
You can use .htaccess to redirect specific countries.


RewriteEngine on
RewriteCond %{HTTP:Accept-Language} (aa|ab|af|am|ar|as|ay|az|ba|be|bh|bi|bn|bo|br|ca|co|dz|fa|gn|gu|ha|hi|kk|km|ku|ky|lo|lt|lv|mg|mi|mk|ml|mn|mo|mr|ms|mt|my|na|ne|oc|om|or|pa|qu|rn|ru|rw|sa|sd|sg|si|sn|so|ss|st|su|sw|ta|te|tg|th|ti|tk|t l|tn|to|tr|ts|tt|tw|uk|ur|uz|vi|vo|wo|xh|yo|zh|zu) [NC]
RewriteRule .* http://www.SOMEWEBSITE.com [R,L]

Toby
2008-01-25, 11:18 PM
You can also do it with javascript based on browser language setting. I use it to filter out Chinese traffic.
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

if (language.indexOf('zh') > -1 || language.indexOf('zh-cn') > -1 || language.indexOf('zh-hk') > -1 || language.indexOf('zh-mo') > -1 || language.indexOf('zh-tw') > -1 || language.indexOf('zh-sg') > -1)
document.location.href = 'http://www.insert-your-redirect-url-here.com';
</script>

msanchez
2008-01-26, 02:04 AM
well as I understand it filtering by the browser language isn't 100% accurate as not all surfers have their browser set to their native language, but I suppose its better than nothing.

ecchi
2008-01-26, 05:14 AM
You can also do it with javascript based on browser language setting. I use it to filter out Chinese traffic.
Do remember that by filtering by browser language you are NOT filtering by country, but by the language the surfer is happiest with. Most people set their browser to the language they grew up speaking, even if they speak English, live in an English speaking country, and use English 99.9% of the time. For example, using this code you are blocking your site from the majority of American Chinese, if you are redirecting them to a Chinese sponsor you are throwing away this traffic, because your Chinese sponsor will be set up to accept Chinese currency and American Chinese will only have $US in their pocket.

Toby
2008-01-26, 12:12 PM
Do remember that by filtering by browser language you are NOT filtering by country, but by the language the surfer is happiest with. Most people set their browser to the language they grew up speaking, even if they speak English, live in an English speaking country, and use English 99.9% of the time. For example, using this code you are blocking your site from the majority of American Chinese, if you are redirecting them to a Chinese sponsor you are throwing away this traffic, because your Chinese sponsor will be set up to accept Chinese currency and American Chinese will only have $US in their pocket.Yes, I do realize that filtering by browser language isn't the most accurate, and if I were doing more extensive filtering I'd use other methods.

As for American Chinese, while I have no data, I don't really believe that an overwhelming majority would have their browser language set to Chinese. Even so, we're talking about a very small percentage of what is already a relatively small percentage of my incoming traffic. Simply not enough to worry about.

ecchi
2008-01-26, 01:27 PM
As for American Chinese, while I have no data, I don't really believe that an overwhelming majority would have their browser language set to Chinese.
Well, I cannot speak for American Chinese, but I know that most British Chinese and British Italian set the language to Chinese and Italian.

we're talking about a very small percentage of what is already a relatively small percentage of my incoming traffic. Simply not enough to worry about.
I so wish I had your problems "I've so many hundred dollar bills in my wallet, I'm going to throw out all the one dollar bills" !!!

Toby
2008-01-26, 01:58 PM
I so wish I had your problems "I've so many hundred dollar bills in my wallet, I'm going to throw out all the one dollar bills" !!!Change those one dollar bills to pennies and your statement may be closer to the truth.

Even if 100% of American Chinese (those whose native language is Chinese) use Chinese as their browser default language, given my current traffic numbers and conversion ratios we're talking about 2 or 3 sales per year that I might be missing.

Also, I'm not just blocking this Chinese traffic, I'm redirecting it and making an attempt to monetize it in other ways, which is currently generating the equivalent of 3 to 5 sales per month.

ecchi
2008-01-26, 03:39 PM
we're talking about 2 or 3 sales per year that I might be missing.
So, if you are using revshare and getting a decent retention that is about $200 a year. You are still doing better than me if you can consider $200 "pennies".

Toby
2008-01-26, 03:55 PM
So, if you are using revshare and getting a decent retention that is about $200 a year. You are still doing better than me if you can consider $200 "pennies".That's assuming I'm really missing out on those sales. I'm not convinced that I am. What I am convinced about is that I'm not sending a bunch of worthless traffic to my trade partners and I'm not burning bandwidth on Chinese surfers that couldn't join a site if they wanted to.

For me, the cost in terms of time and software to be able to more accurately filter that traffic outweighs the potential benefits of doing so. The circumstances for your business may be different.

ecchi
2008-01-26, 04:03 PM
is that I'm not sending a bunch of worthless traffic to my trade partners
Well that at least puts you a head and shoulders above most other WMs. I can usually tell if my trading partners use geo-filtering because they dump the shit on me!

Vendzilla
2008-01-28, 05:50 PM
it's build into E power trader, they have a nice little country redirect that works pretty cool

NY Jester
2008-01-29, 08:10 AM
Toby thats exactly what I wanted it for thank you. Does that work for you? What type of redirect URL do you use?

***

Toby
2008-01-29, 11:20 AM
Toby thats exactly what I wanted it for thank you. Does that work for you? What type of redirect URL do you use?It seems to work reasonably well. I redirect to a page with Pay Per Click links.

P.S. you have a PM

NY Jester
2008-01-29, 11:39 AM
Ill have to work on it. Thanks all for the feedback

Mr Spock
2008-01-30, 02:24 PM
I got blacklisted by a small time TGP owner for redirecting Chinese traffic? What do most LL owners feel about redirecting crap traffic?

ecchi
2008-02-04, 09:43 AM
I got blacklisted by a small time TGP owner for redirecting Chinese traffic? What do most LL owners feel about redirecting crap traffic?
Most probably you were blacklisted by the script. Too many LL and TGP WMs let the script do too much and they do things like blacklist you for any redirect whatsoever, regardless of whether the WM objects to geo-redirect.

However having said that, the last time I checked, several bigger LLs and TGPs stated "no geo-redirect" in their rules - EVEN SPONSOR REDIRECTS (i.e. you link to bongo-porn.com, Bongo Porn does not want Chinese traffic so redirects it to a non CC type site, you don't even know this is happening, but you get blacklisted for it).

Mr Spock
2008-02-04, 11:30 AM
Most probably you were blacklisted by the script. Too many LL and TGP WMs let the script do too much and they do things like blacklist you for any redirect whatsoever, regardless of whether the WM objects to geo-redirect.

However having said that, the last time I checked, several bigger LLs and TGPs stated "no geo-redirect" in their rules - EVEN SPONSOR REDIRECTS (i.e. you link to bongo-porn.com, Bongo Porn does not want Chinese traffic so redirects it to a non CC type site, you don't even know this is happening, but you get blacklisted for it).

I don't understand why anyone would object to redirecting Chinese or any other crap traffic for that matter.

Mr Spock
2008-02-04, 11:54 AM
Most probably you were blacklisted by the script. Too many LL and TGP WMs let the script do too much and they do things like blacklist you for any redirect whatsoever, regardless of whether the WM objects to geo-redirect.

However having said that, the last time I checked, several bigger LLs and TGPs stated "no geo-redirect" in their rules - EVEN SPONSOR REDIRECTS (i.e. you link to bongo-porn.com, Bongo Porn does not want Chinese traffic so redirects it to a non CC type site, you don't even know this is happening, but you get blacklisted for it).

I don't understand why anyone would object to redirecting Chinese or any other crap traffic for that matter.

ecchi
2008-02-10, 10:07 AM
I don't understand why anyone would object to redirecting Chinese or any other crap traffic for that matter.
The workings of the minds of LL and TGP site owners are a mystery to me too, sometimes. :)

Especially that green fellow. :D

divinegoddess
2008-02-10, 05:20 PM
I use this script to relocate some custommers

<?php
$IPaddress=$REMOTE_ADDR;
$two_letter_country_code=iptocountry($IPaddress);

if ($two_letter_country_code=="BE"){
include("redirect.php");
exit;}
else{
if ($two_letter_country_code=="NL"){
include("redirect.php");
exit;}
else{}
}

function iptocountry($ip) {
$numbers = preg_split( "/\./", $ip);
include("ip_files/".$numbers[0].".php");
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if($key<=$code){
if($ranges[$key][0]>=$code){$country=$ranges[$key][1];break;}
}
}
if ($country==""){$country="unkown";}
return $country;
}
?>

Lace
2008-02-27, 09:01 PM
Nice thread! I'm going to have to do some redirecting on my new mobile site here soon :) THanks!

RageCash-Ben
2008-02-27, 09:51 PM
I use this script to relocate some custommers

<?php
$IPaddress=$REMOTE_ADDR;
$two_letter_country_code=iptocountry($IPaddress);

if ($two_letter_country_code=="BE"){
include("redirect.php");
exit;}
else{
if ($two_letter_country_code=="NL"){
include("redirect.php");
exit;}
else{}
}

function iptocountry($ip) {
$numbers = preg_split( "/\./", $ip);
include("ip_files/".$numbers[0].".php");
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
foreach($ranges as $key => $value){
if($key<=$code){
if($ranges[$key][0]>=$code){$country=$ranges[$key][1];break;}
}
}
if ($country==""){$country="unkown";}
return $country;
}
?>

thanks for posting that DG |thumb

buttster
2008-03-03, 04:51 AM
You can use .htaccess to redirect specific countries.


RewriteEngine on
RewriteCond %{HTTP:Accept-Language} (aa|ab|af|am|ar|as|ay|az|ba|be|bh|bi|bn|bo|br|ca|co|dz|fa|gn|gu|ha|hi|kk|km|ku|ky|lo|lt|lv|mg|mi|mk|ml|mn|mo|mr|ms|mt|my|na|ne|oc|om|or|pa|qu|rn|ru|rw|sa|sd|sg|si|sn|so|ss|st|su|sw|ta|te|tg|th|ti|tk|t l|tn|to|tr|ts|tt|tw|uk|ur|uz|vi|vo|wo|xh|yo|zh|zu) [NC]
RewriteRule .* http://www.SOMEWEBSITE.com [R,L]


I am getting a ton of chinese traffic from chinese bbs sites, how would I set this code up to stop all chinese traffic. Any help would be appreciated.

emjay
2008-05-24, 06:22 AM
I am getting a ton of chinese traffic from chinese bbs sites, how would I set this code up to stop all chinese traffic. Any help would be appreciated.

Hey Buttster, given that fear of shrinking penis is firmly hardwired into most Chinese men's brains, you might want to consider sending them to www.penistrainingworld.com :D

Select 'China' from the country drop down menu to see what a surfer from there will see|headbang|

Danielle
2008-05-24, 06:28 AM
http://www.trafficassistant.com/ Works great.

Hugs,
Danielle