Tuesday, 29 November 2011

BANNER AD ROTATOR

If you want to rotate banner advertisements on your web page, you are in luck. You can use the simple and straight forward Ad Rotator component, which comes standard with ASP.

The first thing you need to do is create a text file called adrotator.txt and copy the code below:

REDIRECT /anyfile.asp
WIDTH 468
HEIGHT 60
BORDER 1
*
http://www.YOUR_DOMAIN_NAME.com/images/banner1.gif
http://www.ADVERTISER1_DOMAIN_NAME.com
Visit Advertiser1 now!
25
http://www.YOUR_DOMAIN_NAME.com/images/banner2.gif
http://www.ADVERTISER2_DOMAIN_NAME.com
Visit Advertiser2 now!
25
http://www.YOUR_DOMAIN_NAME.com/images/banner3.gif
http://www.ADVERTISER3_DOMAIN_NAME.com
Visit Advertiser3 now!
40
http://www.YOUR_DOMAIN_NAME.com/images/banner4.gif
http://www.ADVERTISER4_DOMAIN_NAME.com
Visit Advertiser4 now!
10

This schedule has four banner ads in it. The top four lines are optional, but the * is required. The Redirect send all banner ad clicks to a specified ASP file, you can use this option if you want to track banner ad statistics. The Width and Height set the dimensions of the banner ad, and the Border sets the border thickness around the banner.

After the *, you can list as manny banners as you want. Each banner that you list, consists of four lines: 1) URL of banner ad image; 2) URL users will be sent to when they click on the banner ad; 3) the image ALT text; and 4) the percentage of time that you want the banner to display on the page (must total 100 naturally).

Next, paste the following code to any ASP page where you want to display your banner ads:

<% DIM strBanners Set strBanners = Server.CreateObject("MSWC.AdRotator") Response.Write (strBanners.GetAdvertisement("/adrotator.txt")) %>

All done. Now you have a professional looking banner ad rotation system. Now, it's up to you to go out and find some advertisers!

http://www.aspwebpro.com/aspscripts/contentmgmt/banneradrotator.asp

No comments:

Post a Comment