Example of a dynamic AD management program

Source: Internet
Author: User
Tags implement
Program | news | Advertising by Wayne Berry
This Issue
Many sites that are content specific depend to banner for advertisement. Such is the case for 15
Seconds. A banner is displayed on the page for every page viewed. Clients usually buy a set
Number of Banner impressions and impressions are rotated amongst all the clients over a period of
Time. In order to do this there must is a dynamic quality to the banners. In other words, the banner to
The display is not determined until the page is requested.
With a Active Server page This is a easy task. Active Server Pages are dynamic and there are many
Components that handle the task of banner rotation. A Simple one comes free with the Internet information
Server, and more complicated rotation schedules can do with Site Server and third
Components. This article isn't about how to implement these components within your Active Server pages,
Since this are a fairly easy task.

This article would describe how to implement a banner rotation scenario where the pages served are static,
i.e. htm, and don't have the flexibility to call components. The task is to dynamically serve banners
and statically serve pages. This is the opposite of the scenario for banner rotation components, which
Statically serve banners and dynamically serve pages.

One trick
There is only one trick here and once for you know it's the rest is pretty straightforward. Internet Explorer
And Netscape allow to refer to a Active Server Page within an image tag. Example 1 demonstrates the
The HTML to is inserted in the static page.
Example 1:html Banner Reference



< IMG src= "http://www.myserver.com/ServeBanner.asp" >


Once your have referred to a dynamic active Server page with the static page, and you are need to build an active
Server page to return a banner. Example 2 shows the code to use for servebanner.asp
Which is called in Example 1.

Example 2:servebanner.asp Source



<%
Response.Redirect ("Banner.gif")
%>


These two pages combined would allow you to display to the user a banner as if you referred directly to the
Banner image instead of an Active Server page. In the order to does banner rotation all your have to does is expand
Example 2 So different images come up every time servebanner.asp is called.

Adding the Element of rotation.
With this technique the dynamic aspect of the banner rotation is controlled within the Active Server page
That's the IMG tag is referring to. In order to randomly rotate the banners you'll need to change
Serverbanner.asp to choose a different banner the it is called. Example 3 shows.
Example 3:rotating Banners



<%

Dim Array (2)

' Initialize the VBScript Random
' Number generator
Randomize

Array (1) = "Banner1.gif"
Array (2) = "Banner2.gif"

Upperbound=ubound (Array)
Lowerbound=1
Lrandom = Int ((upperbound-lowerbound + 1) * Rnd + lowerbound)

Response.Redirect (Array (lrandom))

%>


Notice that you'll have to initialize the array for as many banners as are available and you'll have
To assign a banner to each element of the array.

An Extra benefit
An obvious benefit to this type of the banner rotation is that fact ' don ' t have to serve Active Server
Pages in order to have rotating banners. If the only dynamic aspect of your Active Server page was to
Rotate banners You'll want to the "change it" to "use" this banner rotation technique, since it'll reduce the
Stress on your server.
It might not being so obvious this static pages no longer need to reside on your machine to rotate
Banners. For example, your could give the HTML in Example 1 to a site this you were advertising on, and
When they serve there pages with your HTML your server'll rotate the banners for their site. This allows
What banners are presented to their readers. The site that is serving the static pages
Could even be a different operating system, such as UNIX.

Clicking on the Banner
So far we have demonstrated I to rotate banners, but don't how to activate those
Click on the banner to another site. With one banner in the rotation this is a straightforward
Process, you just point the anchor tag to



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.