Courant News: Ads


04.14.09 Posted in Courant News by Max

One of the big prob­lems with a cer­tain pop­u­lar online pub­lish­ing plat­form for col­lege news is that the ser­vice takes a major cut of the site’s ad rev­enue in return for cov­er­ing the host­ing and infra­struc­ture costs. There­fore, a major appeal of mov­ing off said plat­form and run­ning your own site is that you get full con­trol of your adver­tis­ing. Today’s post is about how we han­dle ads in Courant News.

Early on in the process, we decided that cre­at­ing an adver­tis­ing sys­tem was really out­side of our pri­mary area of focus, and there­fore we were not going to pur­sue cre­at­ing a sys­tem to han­dle and serve ads. Prod­ucts like OpenX and Google Ad Man­ager (GAM) are quite excel­lent, and it would take us a long time to match their fea­tures and capa­bil­i­ties. Since our pri­mary goal is to build a pub­lish­ing plat­form, and not an adver­tis­ing plat­form, we decided to let peo­ple use what­ever ad serv­ing ser­vice they desired, and that we would sim­ply pro­vide some func­tion­al­ity to aid in integration.

This inte­gra­tion is pretty sim­ple, with some set­tings to put in your cor­re­spond­ing API/account ID, and some tem­plate tags to help inte­grate the ads into your tem­plates. So far, we have only built a set of GAM tem­plate tags, since that is what we have used on the sites being built on Courant so far. How­ever, it should be quite sim­ple to do anal­o­gous sys­tems for OpenX or any other ad platform.

In your tem­plates, you first sim­ply load the tem­plate tag library for your system.

{% load gam %}

Then where you want to put the ad in your tem­plate, you make a sim­ple call with the name of the ad slot to ren­der and the size of the ad.

{% gam_display_ad "TopWideBanner728x90" 728 90 %}

The tag will out­put the cor­re­spond­ing Javascript and HTML for the ad slot “TopWideBanner728x90” with the GAM API key you defined in your set­tings. If your server is in debug/development mode, then it will instead just ren­der an image of the appro­pri­ate size to fill in for the ad (so as not to inflate your ad numbers).

It’s really that sim­ple. As I said above, we plan to also have libraries for OpenX and any other ad ser­vices that peo­ple show inter­est in. Per­haps far down the line we would con­sider imple­ment­ing our own ad plat­form, or at least inte­grat­ing ad man­age­ment into our admin inter­face, but we don’t feel that that is appro­pri­ate at this point in the project’s lifecycle.



Leave a Reply