Rotation of banner adds using ASP.NET
Today advertisement management is one of major area in web development. So I thought of having blog post about that.
Following basic features can be seen in a banner management system.
• Scheduling multiple banners.
Set start and end time frames
Set advertisers that cannot appear on the same page(competitors)
Determine the sequence and timing of display advertising
• Rotation of banner adds
• Banner tracking
Let’s see at following database diagram which I have designed to fulfill above areas.
“ADManager_Category” table can be used to store banner category such as “Top Banner”,”Bottom banner” etc.
“ADManager_Ads” table can be used to store banner details(Name,Image path,Start Date,End Date, start time, end time etc).
To store competitor banner information we can use “ADManager_AdCompetitors” table.
Also we can use “ADManager_Banner_AdTracking” table to store banner tracking information.
After setting up database we can use stored procedure to retrieve random ads from the database. But banner loading procedure should handle following key points.
Check start date, end date, start time, end time to filter valid banners from the database.Remove competitor’s banners from selection.Implement random banner selection based on banner weight factor.
Implemented random banner selection stored procedure (Named GW_Get_Random_Banner) can be found in attached script file.
Download ASP.NET sample project and related database script: Sample BannerManager , Database Script
Note:Download and Unzip the attached project.Create a new database and run attached script file on that database.Open ASP.NET(VS 2008) web project and change “web.config” file connectionStrings setting to reflect your database connection.After that you can run and see the output.




