magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 06 > Programming Feature  

Practical Banner Rotation

By Al Williams

Many Web sites derive some, if not all, of their income from rotating banners. Such income can be monetary, or banners can pay off with reciprocating banner exposures on other Web sites. Banners can rotate any kind of content so that site visitors always see new information.

Several CGI programs are available to rotate ads. But why not use a form of script that's often simpler to manage than CGI? There are a variety of ways you can use client- or server-side script to rotate content. In the simplest case, a random number can select one of several chunks of HTML to display. However, this is only satisfactory for small sites. Larger sites with lots of traffic need more complex scripts to track click-through rates, and perhaps even target ads depending on the current page or other criteria.

I'll show you a few scripts that you can use as a starting point for developing your own rotating-content scripts. I'll start with a very simple example that's nearly universal, but has limited features. Then I'll move on to some more sophisticated applications.

The Basic Model

One way to get simple content rotation is to use JavaScript in the browser. This has several advantages. First, it doesn't require a special type of server because the script is embedded in the HTML and runs in the browser. This can lessen the load on your server. Unfortunately, browsers without JavaScript support won't be able to show your banners. There is a workaround for this, as I'll show you, that allows noncompliant browsers to show a static banner instead of a rotating one.<>




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2