Open Source Geo Targeting
Should a member of your audience in Paris see the exact same content as someone viewing from Paris?
Many times the answer to that question is no, meaning that as the process for globally distributing digital content continues to get faster, cheaper and easier, content developers now have a new challenge —
How do we package and present what we build in a way that maximizes its value to an audience, no matter where on the planet that audience might be located?

One strategy content developers can use to help better serve this global audience is something known as geo targeting.
In a nutshell, geo targeting is the process of capturing a user’s ip address or other identifying information, checking that info against a database that suggests the likely geographic location of that user, and then serving up targeted, customized content based on those results.
Though used for delivering all types of content, one area where the use of geo targeting is rapidly spreading is in online advertising. If you’ve farmed out the management of your ad inventory to a third party advertising network like Google Adsense, the Yahoo Publisher Network, Quigo, Kanoodle etc… , then in many cases they are taking care of this geo targeting for you by placing ads with not only contextual relevence but geographic value as well.
Make no mistake. Those ad networks provide an awesome service and are playing a major part in empowering emerging content developers to monetize their work without having to worry about selling ads directly. But what if through hard work and good fortune you’ve grown to the point where you now want the ability to control your ad inventory to a much finer degree?
Have the tools to implement an ad delivery platform with geo targeting capabilities progressed to the point where they’re reliable and accessible to the small to mid sized independent content developer?
I was recently involved in building the infrastructure for a project that was looking to have this kind of geo targeting capability integrated into a self managed online advertising delivery platform. And based on what was learned during that experience I’d say the independent content developer and publisher does have some options.
Here’s a quick summary -
First, this project adopted an open source philosophy from the ground up going with a FreeBSD based virtual server running Apache, MySQL and PHP. This close cousin of LAMP was bundled with Wordpress as the CMS.
Since we were building on this type of foundation, staying with a MySQL/PHP based solution for the ad delivery component was the preferred option. After considering a couple of different packages out there, OpenAds was selected to handle advertising delivery and management.
I wasn’t familiar with OpenAds before this project, but am very quickly becoming a fan. The power it gives the publisher who wants to control their ad inventory is pretty impressive for an open source application.
Rather than going into great detail about OpenAds here, the best way to learn about it may be to check out the OpenAds online demo for yourself. It can provide you with a pretty good idea of what the app is all about.
If you’re accustomed to installing PHP/MySQL based apps like Wordpress, then the OpenAds download and installation process will likely be in your comfort zone. But if you need some help, that’s ok too as they offer consultancy services for large scale needs, and you can find freelance consultants in the forums as well.

screenshot of openads demo
Ok, so now that your ad delivery platform in place, how exactly do you add geo targeting capability?
Well, one nice thing about OpenAds is that most of the geo targeting groundwork is done for you in the existing code. One item that is left for you to do is acquire one of the GeoIP databases available from Max Mind. You can choose to either purchase, download and install a database on your own server or to subscribe to a web service from MaxMind and receive the information from their servers.
Once acquiring the database you plug it into OpenAds via filling out some form fields within your OpenAds admin area.
There are several geo targeting databases available from MaxMind. You can filter by country, region, city, zip code, area code and more. As one might expect, the more detailed your needs the more expensive your database will likely be.

openads table of maxmind geo targeting databases
You can also try before you buy. MaxMind offers lite versions of some of their databases that you can download and install into OpenAds for free. I went this route and installed their GeoLite City, which is similar to their more robust GeoIP® City Database paid version, just not as accurate and with no support. If you decide you need the extra accuracy and/or support a full version provides, then they drop in right on top of the lite versions.
Nice touch.
After downloading and installing the GeoLite City version, I built a down and dirty test ad campaign and designated it to only be delivered to users based in San Antonio, Texas. I then visited the site from a San Antonio ISP and received that ad. Next, I changed the campaign delivery options to not deliver the ad to San Antonio. I visited the site again and this time was not shown that ad and received a default banner instead.
Simple as that.
Further testing since then has proven the lite version of this database to be more accurate than I expected.

screenshot of selecting geo targeting delivery options in openads
Now if this all sounds too easy so far, then let’s balance things out for a moment here.
OpenAds does have a learning curve.
If you’re familiar with the online advertising world and the general concepts and language spoken there, that then that should help you some. But if you don’t know your Leaderboard from your Skyscraper then you may want spend a little time at the Interactive Advertising Bureau. Among other resources, they offer a helpful rundown of ad unit guidelines that can help get you up to speed quickly.
With OpenAds you’re remarkably free to customize your online ad delivery strategy as you see fit, but if you’re going to be running ads from a wide variety of sources these ad units are the standards many entrenched media buyers look for.
Having spent some time in close proximity to the ad world, this part was familiar to me. Still, the actual step by step process for setting up my first campaign did involve some trial and error learning along the way. From this experience, I’d characterize the OpenAds documentation as adequate, but not exactly exceptional.
Also be aware that there are some scenarios where this approach to geo targeting may not produce the desired results. For example, a user visiting a web site during work from a corporate office on the west coast might be identified by the ip address assigned to the corporate headquarters on the east coast. I’d imagine that just about any user accessing the web via a proxy server runs a high risk of being misidentified.
Another scenario where geo targeting may force content on a user they do not want would be say an English speaking user visiting your site from Germany who doesn’t want to see German Language content or ads but actually wants the English version.
There are workarounds to issues like these, but it’s important to keep in mind that geo targeting isn’t foolproof.
Still, considering the extra power to customize what content you can deliver to your audience based on their location, the tradeoffs may be worth it to you.
Another benefit of adopting an ad delivery platform like OpenAds is that you can keep your existing Google Adwords, Yahoo Publisher Network etc… ads and rotate them with your new locally managed inventory.
In other words, if you don’t have an ad sold yourself, you can fill the inventory with an ad from one of the ad networks. This is a great feature that some of the newer ad networks like AdBrite offer as well.
One final note. The more I worked on this project the more I got to thinking that with a little work a content developer could adopt OpenAds as a vehicle for delivering all types of geo targeted content. Not just ads.
All the power and technology is there. Apply a little of your creativity and OpenAds could be a tool that helps you give your global audience more of what they’re looking for.
———–
A couple related items -
- When this project began, IP2Counry also offered a geo targeting database that worked with OpenAds, but sometime along the way they appear to have stopped selling it to the public.
- While working on this project, OpenAds raised $5 million in funding. And they’re hiring.
- The banner insertion code generated by OpenAds didn’t pass the XHTML validator without some tweaking. There are some solutions offered up on the OpenAds Community Forums. I tried this one which involves modifying some of the existing PHP files. It seemed to solve most of the problems, but am still trying to chase down one issue.
- Microsoft offers a Geo-Targeting Best Practices for advertisers. It’s a quick read and may help frame the issue from the advertiser’s perspective.
- If you’re looking for more help in understanding the language of the online ad man mad men, the IAB also offers a glossary of interactive advertising terms. UT Austin hosts a decent list of advertising terms but it appears to be missing some of the interactive and online advertising terminology. As of the date of this post, I did not see geo targeting listed in either.
- You may have seen this strategy referred to as one word GeoTargeting, two words as Geo Targeting, or hyphenated as Geo-Targeting. Not sure which is the best choice, but for this article Geo Targeting got the nod.
UPDATE 02-15-08: OpenAds has rebranded itself as OpenX. The OpenAds urls are being redirected to the new website at OpenX.org.
Content Developer Comments
Comment on Open Source SMS Text Messaging Application by Creg FieldingTxtWire has a web service that will return the cell phone carrier. Just pass it a phone number and it will tell you who the carrier is even if the phone number is ported from one carrier to another. Our database is updated daily so even numbers that are ported today report correctly tomorrow. If you would like a demo account call. We have several large corporations and online software vendors using the service. cfielding@txtwire.com http://www.txtwire.com Comment on Open Source SMS Text Messaging Application by Kyle2008
Great post DC. Very interesting approach to sending SMS. Is the source code for this actually available anywhere? Thanks! Comment on Open Source SMS Text Messaging Application by JustUs1776
Great post. I'm a LAMP Developer and I was wondering if anyone has been able to build their own GSM server. That is, a server that can utilize a GSM modem to send direct, local messages to cell or IP phones. I'm working for a not-for-profit health care organization and have a suite of applications that I'd like to improve communication turn around time by sending SMS messages our nurses IP phones and our Physician's cell phones. I've found a ton of services that are all cost prohibitive and was hoping for an open source solution. Comment on Open Source SMS Text Messaging Application by Roy
My son's teacher would like to be able to send short text messages to students. I'm looking for a simple solution that would allow him to broadcast to 20-40 students a "reminder" about class info. This article looks very promising, but It appears to be server based. Can this type of program be modified to run run stand-a-lone, ie flash drive, desktop...? comment feed...