Yahoo Publisher Network in the United States

Yahoo only wants US traffic for YPN, and the best way to do that is to do geotargeting on your site. I’m now doing this for Invision Plus, serving both AdSense and YPN for US visitors, and just AdSense for everyone else. Here are the instructions for geotargeting Yahoo Publisher Network ads for US visitors only:

A DigitalPoint thread named Block International Traffic has people discussing several solutions to accomplish the task of geo-targeting your YPN ads. In post # 7 you have a well documented plan to implement geo-targeting for your ads.

(1) Download geoIP.dat and geoip.inc and put the files where you would put your php banner script.
(2) Then use this code for your YPN ads;

< ? // 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 "United States": { ?>



< ? } } ?>

That should be it. There are also more details on this page post # 25, specifically.

Leave a Reply