Logo of RobustHost, developer of high quality webmaster tools.
Home About Us Contact Us Support Download Products
DynAds Basic banner ad rotation and tracking script
DynAds
Main Page
Features
Demo & Test
Documents
F.A.Q.
 
Order Online
 
Related Products
DynAds Pro
 
Testimonials
 

Sample Testimonial
Hi Ali, Thanks for the instructions. That's wonderful. You guys have done a great job with Dynads. Regards,
J. Quek, GT Designs & Concepts More...

Affiliates

Scheduled Content Rotation

Have you ever wanted periodically (such as hourly, daily, weekly, biweekly, monthly) changing content (whether a banner ad, an image, a piece of HTML text, or a complete page) on your website pages? What about scheduling the content of your pages, such as showing one content for a duration of N time periods and then the other for the duration of M time periods? What if you want to rotate banner ads among your pages periodically to provide better and even exposure? For example, the ad shows on the page-A the first day, and on page-B the next day, etc. Do you want to display a new set of pages every week automatically?

For sure, you can always manually change and update the content if you have sufficient time and energy. But, do you know you can do timed ad rotation with DynAds automatically?

DynAds on the other hand does not have the built-in support for the timed ads except the auto-disable upon date-time function. That is you can only specify the end date-time for the ads or categories. However, thanks to the good interaction of DynAds with other scripting languages such as browser side Java Script and server side PHP, you can still implement the timed ads.

In the following sections we will present several methods to implement timed ads and contents with DynAds.

Arbitrarily Timed Ad Campaigns

Assume that you want to display an ad for N0 time periods, and after that another ad for N1 time periods, and after that another ad for N2 time periods. Of course, the periods could be just equal, N0=N1=N2=N. As an example, Suppose that you want to enter 3 months worth of ads (or content) into the system that will change every week, and then you want to forget it for 3 months. Since the content will be changing every week, you need to define total of 3*4=12 ads in advance.

With DynAds, although you can not specify the start date-time for the ads, you can still implement arbitrarily timed ads. First define 12 ads. For the first ad, enter the end of the first week as the expire date-time. Similarly for the second ad set the expire time to the end of second week. For the third ad set the end of third week, and so on. Then create an ad group, and add the timed ads to the ad group. Order the ads in the ad group so that the ad of the first week is first and the ad of the last week is last. Then enter to the "Code Generator" menu and obtain the access code for the ad group with sequential ad selection and with the ad index set to zero. For example, the access code for SSI could be:

The code selects the first active ad in the ad group. Note that for the first week, all of the ads will be active, but the code will select only the first ad. The second week, the first ad will be disabled automatically and the second ad will be the first ad of the active ads and it will be selected. The last week, only the last ad will be active and selected.

Although we have given the examples for equal weekly intervals, you can define the active periods of the ads any duration you want.

Periodically Rotating and Page Shifting Ads

Assume that you have N ads to rotate on your M pages where M >= N. You want the ads rotated at every day and the ads shifted to the next page each day. That is, if ad-1 is shown on page-A in a day, then it will be shown on page-B on the next day, and on page-C the other day.

In DynAds define your ads and put them in an ad group for rotation. Then use the following java script code on every page you want the ads rotated.

PageNo variable is used to differentiate the pages. Assign consecutive numbers to your pages. The pages having the same number will show the same ad.
PeriodHour variable sets the period of the ads in hours.
ScriptUrl should be set to your installation of DynAds.
AdNoOffset is used for adjusting the starting ad in the ad group.
AdGroup is the name of the ad group in DynAds database.
DispPosName is used for reports. Assign a distinguishing name for the particular display position.

The script first obtains the current time of the computer and quantizes that time to the ad period. This gives a number that increments at every Period. DynAds has the property that, when the requested ad number is higher than the number of ads in the ad group, then a modulus operation is done. For example, if there are 10 ads in the ad group and if we request the ad no 107, then the ad with the index of 7 (the 8th ad in the ad group) is returned. Similarly 110 returns the ad with index of 0 (1st ad), etc. So the script uses this fact. At every Period, the AdNo is incremented by one, and thus the next ad in the ad group is displayed. You can use the AdNoOffset to adjust the starting ad number. At the last statement, the Java Script generates the actual code that retrieves the ad from DynAds.

Arbitrarily Timed Periodic Ad Campaigns

Suppose that you want to display a group of ads in sequence for arbitrary durations and in arbitrary order. Furthermore, you want the ads restart from the beginning after all the ads are displayed. That is, you want to create a schedule of ads.

With the help of some Java scripts, you can create a schedule in DynAds (Pro) admin panel and edit it any time you want. Here we will explain it for DynAds. Implementing it in DynAds Pro is similar.

First create an ad to enter the schedule information. Write the schedule in the Header HTML field of the ad in the format as shown below.

"Type periodic" line is for future reference. Currently there is no other types.
AdGroup line specifies the name of the ad group where the ads will be pulled.
Start line indicates the time the first ad in the schedule is assumed active. It is used to adjust the phase of the ads.
After the Schedule line, the ads to be rotated are listed. In each line the index of the ad in the ad group and its corresponding duration are specified. The duration can be defined as an arithmetic expression. The ads will be shown in the order given starting from the Start date-time.

The example below shows a schedule in order to display the ads in the reverse order of the ad group TextAds having four ads. Every ad is assigned a different duration. And the phase of the ads are adjusted so that the first ad in the schedule (index 3) is assumed active on 2002/9/1 10:30:0. The ads will start from the beginning after the last ad is displayed. The total period is 7 days.

After defining the schedule ad, create an ad group, and put the schedule ad in that ad group. Now you have 2 ad groups: 1 for the schedule ad, and the other for the actual ads to be rotated.

Then on each page you want the ads displayed, put the following code in the HEAD section. Code defines the common functions used for retrieving and parsing the schedule from DynAds database

Then put the following code where the ad should appear.

The above code will first download the schedule itself from DynAds. Then it will parse the schedule and decide which ad should be selected for that time. Finally it will retrieve and display the selected ad from DynAds.

The good thing about this approach is that you do not have to edit the code in pages in order to change the schedule. All you have to do is just to change the content of the schedule ad in the control panel.


Copyright © 2003, RobustHost.com. All Rights Reserved.