Geo targeting your ads with Ad Buttons

Written by Nico on September 14, 2009 – 6:39 am -

The plugin has been download over 10,000 times to date and I’m still getting a lot of positive feedback on it. This encourages me to keep working on the plugin and keep adding new features. Today I’m proud to present a feature that I have been thinking about for quite a while: country based ad serving, aka geo targeting.

A lot of CPA programs only pay for conversions from certain countries. There is no point in showing these ads to people from other countries. It would be better to show these visitors other ads.

Per Gustafsson has made the ip2nation database that enables you to retrieve the visitors country. I have incorporated the ip2nation database into the latest Ad Buttons plugin release. This enables the program to know from which country your visitor is and enables you to control which ads are served.

Unlike other ip2nation plugins that are available, Ad Buttons is currently using the latest version of the ip2nation database and has update functionality already build into the admin panel so you can update the database with one click when a new version is released.


Other Posts you might like:


Tags: , , , ,
Posted in WP Ad Buttons plugin, blogging tools, make money, plugins | 9 Comments »

9 Comments to “Geo targeting your ads with Ad Buttons”

  1. Luis Says:

    Hi!

    Thanks in advance for this awesome plugin. I have a strange problem, i’m using wordpress 2.8.4 and ad buttons 1.7, when i visit the website with iexplorer the ad image is visible but with firefox (3.5.3) the ad image dont show up. ¿Any idea?

  2. Nico Says:

    Luis, your problem sounds like a local cache problem to me. Try reloading the page in firefox by pressing [ctrl] + [F5]

  3. Luis Says:

    Hi Nico.

    That was what i thought but no… If you want to check it for yourself please visit http://www.desaparezca.net/blog2 with both navigators (iexplorer and firefox). There is only one ad, at the right panel, is called Ads!.

    Thanks in advance.

  4. Nico Says:

    Looks good to me in both FF and IE. Try clearing your cache and history in FF. I have had similar problems with some other site, where my ISP was serving me a cached version of images. If that is the case, maybe give it a day and the problem should fix itself.
    The page is created by the code on the server, so there can be no difference between what FF and IE see, also the output of the script is a simple link and image, nothing special.

  5. Rob Says:

    Hey Nico!

    Great plug-in, but I like it so much that I’d really like to use it more than once so that I can break up my ads.

    Maybe in a future release you could make it so that I could create more than one instance for my site?

  6. Nico Says:

    Rob, that is something that will quite likely be added in a future release of the Ad Buttons plugin

  7. Jeet Says:

    Hi Nico!
    Agreed to Rob – great plugin.
    Thanks for keeping it free.
    Im sure that everyone should measure the increase in income from your plugin and share it with you through donation :)
    Thanks again for your work.

  8. Jon Says:

    Hi, I posted this on Wordpress.org, but maybe here is a better place to ask.

    I am using Adbuttons specifically for the geotargeting to display different ads to UK and US viewers. I have 4 125px ads for each country.

    What I could love is a way to display some additional adverts by placing code in template files (e.g. single.php) and using the geo targeting database to do this. For example, I have one advertiser that only wants to show ads to UK, and the advert is javascript so cannot use img/url anyway. Is this possible? I am sure it must be relatively simple, and would be good to make use of the geo targeting database.

  9. Nico Says:

    Jon, the plugin uses the ip2nation database by Per Gustafsson There are a few code samples on how to use it on his site. Using one of the samples, here’s something you can try:


    $sql = 'SELECT
    country
    FROM
    ip2nation
    WHERE
    ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
    ORDER BY
    ip DESC
    LIMIT 0,1';

    list($country) = mysql_fetch_row(mysql_query($sql));

    switch ($country) {
    case 'se':
    // Show Swedish ad
    echo"YOUR SWEDISH AD CODE HERE";
    exit;
    case 'us':
    // Show US ad
    echo"THIS IS WHERE THE US AD CODE GOES";
    exit;
    default:
    // Ad for the rest of the world
    echo"AD CODE TO SHOW TO OTHERS";
    exit;
    }

Leave a Comment

RSS

  • Subscription

    Fill out the form below to signup to our blog newsletter and we'll drop you a line when new articles come up.

    email address:

  • Categories

  • Tags

  • Archives

  • Top Commenters

  • Sponsored Links

    Adgitize your web site.
  • Recent Posts

  • blogarama - the blog directory