ASPAlliance Home
Advertise with us
About Prasad KVNM
Refer this Site
                                               
Home Advertisement Management Systems KV's Kool ASP
Search
Samples/Articles
Convert URLs into Hyperlinks

Advertisement Management Systems

AdRotator Component

Extending AdRotator Component

Simple Alternative to AdRotator

A more powerful Ad Management System

Opinion Poll

Suggestions/Snippets
Passing Special Characters through URL

Date delimiter for Access and SQL Server

CDBL instead of CSNG

Handling Database Errors

Avoid Partial Updates to the Database

Book Review
C# and the .NET Platform

Favorite Links
ASPLists.com
ASPNG.com
Computer Dictionary
LearnASP.com

Microsoft .NET
Search @ Google
Wrox Press
Freecode.com

Site by Prasad KVNM,
New Jersey, USA
prasad@kunisetty.com
last updated on
22nd Oct, 2001



A more powerful Ad Management System

Do you want to know

How many times each advertisement displayed in a specific period of time?
Display a particular advertisement based on a user profile
Stop displaying an advertisement as soon as it is displayed 100,000 times
Display an advertisement only up to 15th of next month
Prevent an advertisement if it already displayed...

you have come to the right place!

As this is a part of a set of articles on Advertisement Management Systems, I request you to go through the other related articles for better understanding of this article.

Now you are going to create a database oriented advertisement management system which will take care of all the above issues.

To implement it, you should have two tables in the database similar to the following. In this example we are using SQL Server 7.0 as the database.

Table Name: AdvtStats
Field Name Field Details Description
advtCode VarChar(10) A Unique Advertisement code - This is the common field in both the tables
period DateTime Period for which we are tracking the statistics
impressions Integer Total number of impressions served in this period for this advertisement
clickThrough Integer Total number of advertisement clicks in this period for this advertisement


Table Name: Advertisements
Field Name Field Details Description
advtCode VarChar(10) This is the common field in both the tables
url VarChar(255) The destination URL when the user clicks on the advertisement
imageUrl VarChar(255) Location of the Image of the Advertisement
altText VarChar(100) Alternative Text of the Advertisement
dateFrom DateTime The advertisement will be live from this date
dateTo Datetime The advertisement will be live up to this date
stockImpressions Integer Total Number of advertisement impressions to be delivered
stockClickThrough Integer The advertisement will be live till the total Number of advertisement clicks reach this level
keywords VarChar(255) Display this advertisement only when the user input matches with these keywords

Now create a file similar to "adServe.asp", which is described in Simple Alternative to AdRotator Component, to retrieve an advertisement's information from the database. We have used a random number and a Select Case structure in Simple Alternative to AdRotator Component, where as here we will use an SQL query to retrieve one advertisement's data from the database. 

For example you can query the advertisements table of the database for a record where stockImpressions are more than zero. Or you can query for a record where the current system date is between the dateFrom and dateTo. You can even query for an advertisement whose keywords contain the keywords supplied by the user, if this advertisement system is being implemented in a Search Engine. Or the keywords can be hard coded in the page that calls the adServe.asp page and its showAd function. This is to give you an idea how to create a more powerful Advertisement System. The database structure and the logic to retrieve an advertisement is totally depends upon the requirements and the implementation scenario.

Remember to decrease the stockImpressions value by one in the advertisements table after you get the advertisement. Also you need to increase the impressions value by one in the advtStats table, for the corresponding advertisement and the period.

Then call this retrieval function from your asp page where you want to place the advertisement. If you want to track the click through (how many users have clicked on the advertisement), then you have to implement advertisement redirection that was described in Extending AdRotator Component.

If you want to prevent an advertisement that was already appeared to the current visitor, you may have to store 3 or 4 (depending upon your requirement) last displayed advertisement's codes in a session variable. Write your SQL query such that the advertisement should not be in this session variable. This will make sure that the user will not get the same advertisement again and more number of advertisements will be shown to the user. These strategies will increase the click through - the aim behind the advertisement management.

Hope I am able to tell you what you are looking for.

Mail your comments (and doubts) to pkvnm@yahoo.com

Back to: Advertisement Management Systems - Overview



Refer this site ASPAlliance.com |  Contact Us |  Join |  Advertise |  Best Viewed with IE 4.0 or above