xlogger |
05-04-2006 04:51 PM |
Ok guys, i found the greatest (free) tool for webmasters!
So, i never really paid attention to the fact that i was sending forign traffic to my sponsor that wasnt converting. All it does it make the stats look bad.So i found a tool that will let you geo-ip your ads on your site. Meaning, lets say one visitor is from the US - he will see a ad for a us sponsor and the other chinese one will see an ad for a dialor or w/e. This is not one of those "look at surfers browser" type of things. This looks at the ip and determins the country. Im not really good at explaining things but i will do my best here! mkkay
Step by step:
1. Download these files:
- GeoIP.dat from http://www.maxmind.com/app/geoip_country (they update the geo every month)
- geoip.inc from http://www.maxmind.com/download/geoip/api/php/
and put them in the folder where your php banner script will be.
2. The php banner script
Code:
<?
// This part gets the ip of the visitor and matches it to a country name/code
include("geoip.inc");
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
$visitor_country_code=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
$visitor_country_name=geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']);
//This part shows banners/codes that YOU decide for each country
switch ($visitor_country_name) {
case "China": { ?>
<-- WHAT EVER CRAPPY BANNER YOU WANT TO SHOW FOR BELGIUM GOES HERE -->
<? }
break;
case "Taiwan": { ?>
<-- WHAT EVER CRAPPY BANNER YOU WANT TO SHOW FOR TAIWAN GOES HERE -->
<? }
break;
// AND SO ON, YOU CAN ADD MORE COUNTRIES HERE JUST LIKE ABOVE
default: { // THIS WILL EXECUTE FOR ALL OTHER DESTINATIONS NOT MENTIONED ABOVE ?>
<-- SEX SEARCH OR TCG BANNER SUITABLE FOR FOR OTHER DESTINATIONS -->
<? }
}
?>
3. Look at my sig and sign up
hehe, not really but you should!
|