No, I'm not starting another project and I'm not starting another blog series. First I had a problem/question/idea, then I did a little research, and now I'm just doing a little prototyping to see what's feasible.
I would like to use ads from other networks in addition to Adsense on my site. I wondered what it would take to build something for my sites that would rotate ads from various ad networks rather than have to put in more ad placements to serve that purpose.
Following are my requirements starting with the most important (for now). These requirements could easily be delivered in stages:
In a comment to my initial post Leo Nelson said BanManPro was the only good .NET ad management solution that he had found in his research, but he pointed me to a PHP solution called OpenAds. I looked into OpenAds, read the history, downloaded the code (it is GPL) and poked around a bit. It has some nice features and the newer branch v2.3 (AKA Max Media Manager) looks very promising.
Additionally, I found a "simple" PHP Ad Rotator on the Idealog. The author's desires sound similar to my own.
Based on what I've seen so far I believe that I have 4 options:
For now my decision is to table the decision. I may look into OpenAds further if I decide I need something sooner rather than later. But as part of process leading to that decision I developed a spike to determine the feasibility of building my own .NET system. And after all that introduction we're finally getting to what this post was supposed to be about: a description of that development spike.
I felt that the most important thing to prototype was the actual rendering of the ads, the main point of the system. Along with the rendering I needed to see if I could render ads from different networks/affiliates using a single simplified interface. To do this I chose to build an ad rendering engine that makes use of a provider model to hand off the rendering details to the provider for each specific ad network. The providers each implement IAdProvider and only really have one public method: Render().
Fundamentally the engine itself is simple, it takes a set of parameters (Ad Network, Text or Image or Both, Width, Height, Background Color, Border Color, etc), based on the network type it instantiates the proper provider for it, and then tells the provider to Render.
Below are two screenshots, one showing Google Adsense ads being rendered and the other showing Amazon ads:
Ah, which brings me to the simplified interface. Because I'm choosing to deliver ads from multiple vendors I'm only implementing a subset of what each one is capable - the least common denominator. At this point I have only looked at two vendors so I haven't had to pare down each one's offerings too badly. But I imagine that as support is added for more vendors the options might have to be whittled down further. Luckily it seems that there is a set of standard ad sizes and that will end up being what this system is capable of - the standard ads (large banner ads, small banner ads, skyscrapers, 250x250 squares, etc). There are a lot of cool ad options that Amazon will do, though, that just won't fit into this. One alternative is to choose a larger set and have the providers notify which ones they will support (and/or choke on the ones they do not!). Another alternative is to keep the smaller set of standardized ads but to allow for custom ads to be defined on a one-off basis. Eventually a decision would have to be made on which way to go with that.
That's where this exercise probably ends. At some point I may decide to go through with my requirement #2, building a local configuration system that will handle the rotation of ads, but I doubt that I'll build an all-out ad server system (at least no time in the near future). If nothing else, I learned quite a bit more about ad networks and their ads and came up with a long, in not comprehensive, list of some different ad/affiliate networks that should continue to serve as a good resource. Hopefully my sharing has allowed you to learn something as well. If you have any questions feel free to comment or email me and I'll do my best to answer them.