Swap-bot is in need of a new platform to manage our ads. The previous application we used to manage our inventory recently went through some changes and stopped meeting our needs. As a result, I started looking around for a new system to use. After a some investigation, I decided to build my own and get exactly what we needed instead of adapting to a system that isn’t quite right.
The goal of an ad management platform is to maximize revenue for the publisher, which is done by showing whichever ad will pay the most money at that exact moment to that exact user. That, unfortunately, is much easier said than done. We work with multiple ad networks and have no idea how much they will pay us for each impression until a couple hours or days after it is served. So what do we do?
The basic strategy goes something like this:
- Send the first three impressions by a user that day to Network A
- Send the next five impressions to Network B
- Send the next four impressions to Network C
- Send all remaining impressions to Network Z
There currently isn’t a great way to do this. To maximize your revenue takes tedious analysis and lots of trial and error. You never know how many ads a user is going to see, so you want to show the real money makers first.
To see how much each network pays takes time and testing. When evaluating a new network to figure out where in the order they belong you should start by sending it three unique impressions per user per day. After about a week of this you will have a good idea of where the network stands in relation to your other networks. You should run any reports that the new network allows to get a good idea of where you are making most of your money. You should be able to learn which metrics are important to this network and then send it more of what it wants and stop sending it what it doesn’t want.
After doing this for a few years with Swap-bot ads, I have found that geography and obviously frequency are the most important differentiating factors for Swap-bot users. This means that Swap-bot users are similar on any other metrics that are important to advertisers.
Knowing this, I have decided to build a super simple ad manager. To start, my management application is only going to take daily user frequency into account. Even though I know that geography is a factor, I don’t really know where to send the foreign traffic, so adding any sort of geo-decisioning at this point wouldn’t pay off. At some point, I will have enough data to re-evaluate and add any other data decisioning in that would help us make more money.
I plan to talk more about the technical specifics in a later post, but the management app is going to be built using:
- The Tornado framework for admin ad management and ad tag serving. Tornado is fast to develop in and faster to serve. Even with two datastore look ups per tag request, I’ve got my app up to about 2,000 requests per second on a low-end development machine. Unfortunately, that is more throughput than Swap-bot needs.
- Nginx for handling incoming requests. Nginx is built on top of libevent and is really fast. Also, since Tornado is single-threaded I will need to run one instance of my app per core and use Nginx to reverse proxy to my four instances.
- mongoDB for storing possible ads to serve and user cookies. Using mongoDB really makes this an easy project. It has a feature called upsert that makes tracking ad views simple and correct.
In the coming days and weeks I plan to talk more about everything mentioned here. As I build out my new system I will share the decisions I make.