Ok I found one very complicated script to block out the international traffic but I get confused when I have to read a manual. Has anyone seen a small easy to install script to not display YPN ads to anyone outside the US? I wonder why someone hasnt made one yet and marketed it. Could get a ton of $5 orders! Thanks!
I used the free maxmind db and tied it in with my mysql for quick resolving when the user goes through multiple pages. Its very fast and I haven't noticed any slowups or heavy resource usage. Basically, in your index.php (for example), you grab the IP of the user, check whether its already in mysql, if not, then look it up in the binary file maxmind country db, and store it in mysql. Then my banners being pulled from mysql have a country field. In there I can specify 'us', or '!us' (for everything international), or even 'gb', etc if I wanted to. I also have it set to default to 'us', in case its not found in the maxmind db (an option I couldn't find in the maxmediamanager tool). I was getting crappy money from ADSense, so I turned off (its easy to turn on/off) my alternative ads this morning while I set up different banners that work better on a game and video site , but its still checking. It's cool to see live whos coming and going... If you think there's a real market for such a thing, I'll happily script something up and give it away free to DP testers . -Matt
Do you have PHP and MySQL ? The only large file is the binary db file from maxmind, which is around 800K.
please use the search function this is from the thread: http://forums.digitalpoint.com/showthread.php?t=55428&page=2&highlight=ypn+geo+targeting How not to display YPN to international traffics. Step by step: 1. Download these files: - GeoIP.dat from http://www.maxmind.com/app/geoip_country - geoip.inc from http://www.maxmind.com/download/geoip/api/php/ and put them where your php banner script will be. 2. insert this code for you YPN.
It won't actually be downloading the db every time someone accesses the site. I think a simple PHP script like this (not involving PHPAdsNew or other programs) is the quickest way for your users. If you need a database, I think there are some free hosting companies out there with PHP MySQL or I could even give you a remote one to connect to if you really need it.
ashiezai, This code only works ONCE per page, if you have more than one ad unit it will not work like this. Some suggested putting another close like at the end for $gi, but that doesnt work either.
Would it be possible to include the ip range for the US and hard code it in the php script on the web page? I've never looked at an ip data base before so I don't know how much data / country ip there is but it could be a simple solution to eliminate most of the international add servings. With no mysql required.
So besides general speed concerns, what's the issue here - people don't have/want to use PHP and/or MySQL?
In my opinion, the issue is not about capabilities. Anyone can get PHP & MySQL even on a free host! The problem is, there is no working script thats just a cut and paste job to make work without modification. The one post above in this thread only works once per page, if you try to use it again it does not work and nobody has been able to give an exact code scenario that will work multiple times per page for people that don't know programming. Hence, why it would be such a lucrative business if someone where to develope something that worked multiple times per page and offer it for $5-10 per license etc.
I for one would love to use this and would prefer php and mysql. I also think it would be easier to just us a php include to show the ads. quaffapint, the way you're doing this, does it default back to adsense if the ip does not come from the U.S.?
I'm going to run with ashiezai post for now. It seems to run smoothly. I had to make a couple of mods to the script so could someone with a non US ip address check the results at http://www.enfollc.com/test.php and let me know what they receive? ashiezai- Where could an if else be incorporated to run adsense when the ip isn't US? Since I can't test the script myself for international ips I'm not confident. Good stuff thanks.
Yea - I have my adsense banners country field set to '!us' (not US) - so they display in every country other than the US. (I also have some specific ones for 'gb'.) Its turned on at my arcade site now (for all ads except the one on the right side), if any international DP visitors want to test it out for me . -Matt
I'd be interested in this. I've already got the DB set up using the instructions found here. I'm just having a time with the actual php code to make it work.