Bob Schmuck

February 22, 2007

Filtering Traffic…

Filed under: Uncategorized — admin @ 4:08 pm

In the comments, Dave asked, “How do you have your code setup to display AdSense to non-us people with YPN to us residents?”

Two Easy Steps

  1. Download geoIP.dat and geoIP.inc files (test folder)
    Maxmind.com provides these two files, which will allow you to setup a free version of geotargeting for a php based site with 98% accuracy. The geoIP files are basically a database of countries.
  2. Create the test.php
    Create a test.php file in the same directory as the geoIP files. You’ll be adding the following code into the test.php file. Replace the AdSense and YPN coding with yours also keep the “quotes” in both the ad code with the backslashes as shown. example code. On this page.

You should be able to easily modify the coding to work with your site. To find out more, checkout this article on Advertisement Geotargetting with PHP. It has more in-depth information on doing this.

3 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress