Home arrow PHP arrow Page 4 - Implementing Ad Support Into Your Site With PHPAdsNew

Stats and banner rotations&toc - PHP

PhpAdsNew is one of the most popular open source ad projects on the Internet. We use it right here on devArticles to manage ads for our advertisers, and I would honestly have to say that it's the best ad management system I've ever used. In this article Mitchell's going to give you a guided tour of PhpAdsNew, including how to install it, how to create your first banner, and also how to create your first banner rotation.

  1. Implementing Ad Support Into Your Site With PHPAdsNew
  2. What is PhpAdsNew?
  3. Using PhpAdsNew
  4. Stats and banner rotations
  5. Conclusion
By: Mitchell Harper
Rating: starstarstarstarstar / 10
April 15, 2004

print this article


One of the things I really like about PhpAdsNew is its powerful statistic and graphing capabilities. By simply clicking on the statistics tab in PhpAdsNew, you're presented with detailed stats for each campaign that you're currently running:

PhpAdsNew's powerful statistics features

For each campaign, PhpAdsNew shows its ID, number of ad views, number of ad clicks, and its click thru rate (CTR). Below the details of each campaign is a set of overall stats for all banners, including number of banners shown today, this week and this month, as well as number of clicks and CTR for each of these periods.

On the statistics page, there's also two links to history and weekly statistics. If you click on the history link, then you'll be shown a tabulated list of days and the number of ad views, clicks, and CTR for those days. The weekly statistics link shows much the same things, but in a weekly format.

Sometimes it's handy to have our banner stats available offline, and PhpAdsNew supports this, as you'll see if you click on the reports tab. By simply choosing the campaign you're after, PhpAdsNew will generate a file called campaignhistory.csv, which is a set of values separated by commas. By choosing to open this CSV file, my Windows 2000 server launched Excel, and it looked like this:

The PhpAdsNew report in CSV format in Excel

Of course I've only added one campaign to demonstrate how PhpAdsNew works, but if you had dozens of campaigns, then Excels chart wizard would allow you to create professional looking charts from your PhpAdsNew campaign data, which can be used to form part of your media kit to convince potential advertisers to advertise on your web site.

Banner rotations
One of the best ways to generate more revenue for your site is to setup banner rotations. As compared to normal banners, a rotation contains several (usually 5-20) banners in one ad space, with only on ad being randomly selected to be shown each time. Each advertiser gets a shared amount of impressions, and rotations are great when you're trying to advertise similar products/services to a niche audience.

Setting up a banner rotation with PhpAdsNew is simply a matter of creating at least two banners and then clicking on the administration -> generate bannercode link. The what field is where you specify the criteria for the rotation. For example, if you wanted to setup a rotation with all of your 468x60 banners, then you would enter 468x60 into the text box.

You can also display banners in a rotation based on their name. If you created two banners both with the word test in their name for example, then you can specify test as the value of the what field and all banners with the word test in their name would be displayed in the rotation.

The what field can also accept some rather complex statements, allowing you to specify exactly which banners should be included in a rotation. If you want to match a banner by its ID, you can use the following statement:


On some occasions, it's also handy to display only HTML banners, or only SQL-based banners, etc. We can do this by specifying the format statement in the what field, like this:


As mentioned earlier, you can specify the width of the banners you'd like in the rotation with width x height, just like this:


You can also specify just the width of the banner, like this:


There are dozens of other advanced values for the what field, including matching based on logical operators, the global keyword and more. If you're interested in these other advanced values, then consult the PhpAdsNew documentation, chapter 3.2.

>>> More PHP Articles          >>> More By Mitchell Harper

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: