The Ad Rotator component allows Web developers to put together a list of banners and special placeholders on their pages for these banners. Then, the Ad Rotator component randomly selects a banner and places it in the appropriate placeholder. The select isn't quite random, as you can specify the relative frequency of each banner - one banner may be displayed twice as often as another, and so on.
The drawback of the Ad Rotator component is that it wasn't designed to tune the ads to the viewers. You can't replace the ad selection algorithm with one that takes into consideration the time of the day, the viewer's domain, and so on.
To use the Ad Rotator component, you must create the following:
A Typical Ad Schedule File: AdSchedule.txt
- RedirectionScript is the path and name of the Redirection script on your server
- The width of Banner's placeholder
- The height of Banner's placeholder
- The border width of Banner's placeholder (in pixels)
- The banner detail The first banner detail must follow asterisk(*) and each of them contain 4 lines:
- The URL of the banner's image
- The URL of the destination of the banner (this is the advertiser's home page address)
- A short string about the ad. This string will appear in a tip box when the viewer hovers the pointer over the banner.
- The relative frequency of the banner. If the Schedule File contains three banners and their relative frequencies are 2, 1 and 1, the first banner will be display twice as frequently as either of the others.
Example
<% Set AdObj = Server.CreateObject("MSWC.AdRotator") ScheduleFile = "Ads/AdSchedule.txt" adString = AdObj.GetAdvertisement(ScheduleFile) Set AdObj = Nothing %> <HTML> <CENTER> <H1>Ad Rotator Example</H1> <HR> <%=adString%> <BR>Click on the banner above to visit our sponsors. </CENTER> </HTML>
Output