Geo-Targeting Widgetbucks
Thursday, November 15th, 2007 | Web Thinkering
Widgetbucks has recently announced the they will no longer credit clicks coming from outside the U.S or Canada. Thus geo-targeting ads will help to maximize the performance of your ad spaces. The goal is to show widgetbucks ads only to U.S and Canadian visitors and serve another advertisement in place for visitors from every-where-else. Moreover, geo-targeting can be used to run affiliate campaigns that targets specific countries and other ppc programs like YPN (Yahoo! Publisher Network).
Maxmind provides a free database called GeoLite Country and it is 98% accurate. I used their PHP API in one of my site and it works great.
Instuctions:
1. Download the binary database and the API geo.inc , unzip and upload both files to a new directory on your server.
2. Create a PHP file to query the database.
<?php
include(”geoip.inc”); // the geoip functions
$geofile = geoip_open(”GeoIP.dat”,GEOIP_STANDARD); // open the geoip database
$cc = geoip_country_code_by_addr($geofile, $_SERVER['REMOTE_ADDR']);
geoip_close($geofile); // close the data fileif($cc == “US”) {
// It’s a US visitor. Display widget ads.echo ”
<insert widgetbucks code here>
“;
} // end if USelseif($cc == “CA”) {
// It’s a CA visitor. Display widgetbucks again.
echo ”
<insert widgetbucks code here>
“;
} // end if CAelse {
// It’s a non-US visitor. Display random ads.echo ”
<insert alternate ads here>
“;
} // end else?>
You can include additional countries as necessary.
No comments yet.
Leave a comment
Earn Money
Recent Posts
- Asia Century? Well they didn’t pay me.
- Looking for Eraserheads Concert Tickets?
- Testing Asiacentury Philippines on my websites
- Late Google Adsense Payments via Western Union for July
- Noli De Castro and BJ Penn at UFC 86
- Why Smartbro is the largest Broadband Network in the Philippines
- Moving to Sta. Maria, Bulacan