HomePHP 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.
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:
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:
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:
bannerId
:40
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:
format
:html
As mentioned earlier, you can specify the width of the banners you'd like in the rotation with width x height, just like this:
468x60
You can also specify just the width of the banner, like this:
Width
:468
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.