Block Non-converting, Spam Traffic by Country : GeoIP PECL PHP Geo-Targeting

 

I’m sure webmasters have faced situations where they need a fast, affordable and working solution to block less converting or spam traffic to their websites or pages from certain countries, but either they had to implement slow, inefficient methods or costly professional solutions for their Geo targeting needs.

One of the most popular, free, open-source and hot web programming languages today is PHP. Today, I’m going to share a little trick which efficiently solves the geo-targeting issue; or making your website appear only to a certain demographic you’re targeting and block non-converting or spammy traffic from other countries. Perhaps you know that the IP of the visitors can be translated into country and other info; we are making use of the same in this tutorial.

Geo-targeting, GeoIP or IP to country implementation is a great solution for the following situations, but not limited to them :

* You have a site or web page targeted to visitors from a certain country; say : USA.
* You are getting spammed and fraud orders from a certain country; say : China.
* You don’t want people from certain country or area to access your site.
* You want to block countries which have less conversion for publisher programs like Google Adsense or YPN.
* Your web proxy is being abused and less conversion from ads from countries like China and the Middle East; using up system resources and bandwidth.

Now, let’s come back to the tutorial and setup GeoIP based web traffic filtering.

Requirements and softwares used :

* Preferably Linux OS on server. (tutorial based on Linux)
* Root access to the server or VPS.
* PHP 4.3 or higher installed .
* GeoIP PECL module for PHP.
* GeoIP C API from Maxmind. (We are using the free GeoIP DB, not 100% accurate)
* Moderate Linux Server Administration skills.

The Steps :
1. Login as root to your server through SSH.

2. Download and install latest GeoIP C API.
(remove the - in w-get, there’s some posting restrictions here.)

#w-get http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz

Note the the GeoIP version downloaded.

#tar -zxvf GeoIP-[version number].tar.gz
#cd GeoIP-[version number]
#./configure
#make
#make install

The GeoIP free C API should be installed now.

3. Install GeoIP PECL module for PHP.

#pecl install geoip-0.2.0

v0.2.0 is the the current version at the time of writing this tutorial.
Check PECL GeoIP for more info and use the latest version in the above statement.

Note down where the “geoip.so” file is saved when the installer terminates.

Now, let’s add it to php.ini and restart the web server to take effect.

#whereis php.ini
#nano /path/to/php.ini

Add the following line, preferably in the dynamic extensions section :

extension = “/path/to/geoip.so”

Save and exit.

Restart the web server, assuming Apache on CentOS:

#/sbin/service httpd restart

To verify if GeoIP extension is running, make info.php containing phpinfo() function and upload to your domain
, open it with a browser and search the page for “geoip”.

4. Implement geo-targeting in your website and web pages as necessary.

Here’s an example php snippet if added to the top of a php file
blocks any traffic except USA, UK, Canada and Australia : ( replace [ with < below )

[?php
$country = geoip_country_code_by_name($_SERVER["REMOTE_ADDR"]);
if (!(($country == “US”) or ($country == “CA”) or ($country == “GB”) or ($country == “AU”))) { die(”Service Unavailable!”); }
?]

I hope the above tutorial would help you to address issues related to geo-targeting and banning unwanted traffic from non converting, fraud and spamming
countries.


468

100+ proxy topsite list

 

Here is nice collection of over 100 proxy lists and topsites. Submit your proxy to them and gain an easy 25-50 uniques a day. Once the word is out your traffic will grow on its own.

www.8080proxylist.com
www.activeproxies.org
www.activeproxylist.info
www.agentproxylist.info
www.allproxysites.com
www.proxylocator.info
www.atproxy.net
www.azproxies.com
www.brandnewproxies.net
www.brandnewproxy.net
www.canyouhideme.com
www.carbon-limited.org
www.centerproxylist.info
www.cgiproxy.us
www.choiceproxylist.info
www.cspy.org
www.cyberproxylist.info
www.dataproxylist.info
www.digitalproxylist.info
www.directproxylist.info
www.domainrein.com
www.dreamproxylist.info
www.easyproxylist.info
www.eatproxy.com
www.everyproxysite.com
www.findproxylist.info
www.findproxy.org
www.forceproxylist.info
www.freeproxies.info
www.freeproxylist.info
www.freeproxysite.com
www.freshproxyservers.com
www.fridoz.com
www.getproxies.net
www.getproxylist.info
www.getproxys.com
www.globalproxylist.info
www.goproxylist.info
www.greatproxylist.com
www.homeproxylist.info
www.httpproxy.us
www.hyipforums.us
www.internetproxies.net
www.internetproxy.us
www.interproxylist.info
www.intoeasy.com
www.kenzey.com
www.keyproxylist.info
www.listprox.com
www.liveproxylist.info
www.magicproxylist.info
www.meoso.com
www.myfreshproxylist.com
www.mylinktrain.com
www.myspaceproxies.biz
www.newproxies.biz
www.pcproxylist.info
www.powerproxylist.info
www.prowzer.com
www.proxies.us
www.proxies.vc
www.proxifinder.com
www.proxxies.com
www.proxyblind.org
www.proxygarden.com
www.proxyinter.net
www.proxylicious.com
www.proxylist4u.com
www.proxyliste.com
www.proxylist.ws
www.proxymirror.com
www.proxypointer.com
www.proxyseek.org
www.proxyserverprivacy.com
www.proxyservice.de
www.proxysitelist.info
www.proxyslisted.com
www.proxystuff.info
www.proxytoolbox.com
www.pro-xytoplist.com
www.proxytop.net
www.proxytops.com
www.proxytopsite.com
www.proxytopsitelist.com
www.proxytree.com
www.proxytron.biz
www.proxywebsites.biz
www.prxy.us
www.rightproxies.com
www.schoolproxy.biz
www.serverproxylist.info
www.siteproxylist.info
www.smartproxylist.info
www.starproxylist.info
www.sunproxylist.info
www.surfitproxy.com
www.sweetproxies.com
www.theproxi.com
www.timeproxylist.info
www.topfreeproxies.com
www.topproxysites.net
www.topwebproxies.com
www.topwebproxy.com
www.ultimateproxies.com
www.unlock5.com
www.v6.pp.ru
www.viewproxylist.info
www.webproxies.org
www.webproxylists.com
www.websurfingproxies.net
www.xgxi.com
www.yourproxylist.info
www.proxy-sites.eu
www.proxy-list.co.uk
www.proxies.ch
www.eusko.org
www.proxy.biz
www.lumisade.net
www.proxygroup.info
www.xytheme.com
www.proxywhereabouts.com


How to Block WebSense

 

Websense, Inc. is one of the busiest net abusers. Their stealth scanning never stops.

208.80.193.26 … "GET / HTTP/1.0" 403 4232 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 3304; SV1; .NET CLR 1.1.4322)" "-"
208.80.193.37 … "GET /blog/music/ HTTP/1.0" 403 4232 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Dealio Toolbar 3.1.1; Zango 10.0.370.0)" "-"

Primarily, the abuse is coming from 208.80.193.0/24.

$ nice gunzip -c | egrep '^208.80.19' | awk '{print($1)}' | sort | uniq -c | sort -r -n

35 208.80.193.31
34 208.80.193.44
33 208.80.193.33
30 208.80.193.27
25 208.80.193.37
25 208.80.193.32
22 208.80.193.46
22 208.80.193.30
21 208.80.193.35
20 208.80.193.42
19 208.80.193.45
18 208.80.193.29
16 208.80.193.39
15 208.80.193.40
14 208.80.193.48
14 208.80.193.34
12 208.80.193.47
11 208.80.193.36
6 208.80.193.41
6 208.80.193.38
5 208.80.193.26
4 208.80.193.59
4 208.80.193.50
2 208.80.193.54
1 208.80.193.43

Here are Websense’s netblocks. Block all of them.

* 66.194.6.0/24
* 208.80.192.0/21
* 204.15.64.0/21


Anti-AdBlock V2

 

How it works…
When a normal user visits your site. Their browser will use the CSS within the “advertisement.js” file, which will override the previously posted CSS. When this happens, the “Notice” is not displayed, the page is shown to the viewer.

However, if the user has enabled ad-block, they will not download the advertisement.js file, thinking it is a advertisement. Then CSS will not be overrideen, and the page will be blocked from view, and a notice displayed.

 

[click to continue...]


ByPass Ad Blockers

 

If you’re like me and you’re seeing something like 60 - 70 percent of page views not displaying ads, you might want to let your visitors know that what they’re doing is immoral and ad blocking is going to kill the free internet. I regard 60 - 70% of page views as a staggering proportion that leans dangerously close to making advertising pointless. If that percentage holds true for other sites you can rest assured that their days of either being a free service or even around are numbered.

It’s done using JavaScript with a little creativity to provide some safety against savvy web users who in addition to blocking ads, would otherwise try and block your blocking or notifying them.

 

[click to continue...]


Categories

Archives

Google Ads