Advertising with LAMP

If you want to make money with your web site, running advertisements is a good, first approach. Running ads requires little or no capital expense, and there are several options to sell ad space: you can sell it directly; you can hire a salesperson or consultant to sell it; or you can sign up with an ad network, which matches advertisers with your site.

If you want to make money with your web site, running advertisements is a good, first approach. Running ads requires little or no capital expense, and there are several options to sell ad space: you can sell it directly; you can hire a salesperson or consultant to sell it; or you can sign up with an ad network, which matches advertisers with your site.

Implementing and managing ads is also quite easy, thanks to phpAdsNew, the LAMP ad management software of choice of many webmasters. In this article, let’s look at ad networks and learn how to use phpAdsNew. Counting cash is left as an exercise for the reader.

Signing Up for a Network

Advertising networks are a great way to guarantee a steady stream of monthly revenue when you can’t find targeted sponsors. (For a quick primer on online advertising, see the sidebar “Advertising Adages.”) When considering an ad network, keep several things in mind:

Advertising Adages

You don’t have to work on Madison Avenue to speak the lingo of advertising. Here’s a quick primer:

Targeted sponsor: A company that has direct interest in your audience. For example, Oracle might prefer to purchase a sponsorship directly on the Linux Magazine web site rather than “carpet bomb” across a group of sites. A targeted sponsor almost always commands a higher price, or CPM.

CPM: This acronym stands for cost per one thousand impressions (“M” is Latin for one thousand), and is the standard measurement for a campaign price. For instance, a site that charges $12 CPM charges $12 to display an ad one thousand times. Advertisers may be required to pre-pay a minimum number of impressions, say 25,000.

CPC: Like CPM, cost per click is another measurement for a campaign price. In a CPC campaign, an advertiser pays a specific price for each verified click on an ad.

CPA: Yet another type of campaign, cost per acquisition pays a web site only if a visitor completes an action on the advertiser’s web site, such as registering or purchasing an item.

Above the fold: The section of a web page that is visible without scrolling. Placing an ad above the fold ensures that the ad is seen.

As you may well have guessed, CPM campaigns are best, as you’re (generally) guaranteed to be paid based on exposure only, not performance.

If you run a CPC campaign, you may run the risk of not making money at all, and giving the advertiser “free” exposures on your site.

On the other hand, if your CPM campaign performs poorly on your site, you’ll have a hard time convincing your sponsor to renew their campaign, so make sure to give your sponsors the best exposure as possible.

To ensure that your sponsor gets the best value for their money, make sure your ad spaces appear above the fold, so that the visitor sees the ad without having to scroll.

1. Ad networks charge you a commission on every ad they deliver to your site. Make sure you read the fine print carefully before signing an ad network agreement. Some networks charge up to 50 percent commission on your gross revenue. In that scenario, an ad network CPM of $1.00 nets you only $.50 CPM. This holds true for CPC campaigns as well.

2. Signing up for multiple ad networks has advantages and disadvantages. Yes, you can maximize the number of ads you display, but some networks charge a larger commission if you for sign up with other networks. This is called exclusivity. For example, one network may charge you 30 percent commission for an exclusive contract versus 50 percent if you also use others. Additionally, if you sign up as non-exclusive, a network may not sell your site as diligently as sites that are exclusive.

3. You must audit your own site. Using your own ad delivery system (like phpAdsNew) to serve your network’s ad code lets you compare your traffic statistics to the statistics on your ad network’s site. Don’t be surprised to see an occasional large discrepancy in the two.

To enroll in an ad network, simply apply, using the network’s form. (The sidebar “Plugging In to An Ad Network” lists some well-established and well-respected ad networks to consider.) It usually takes a week or two for an ad network to review your site before accepting it, so it’s a good idea to apply first before installing any software.

Plugging Into An Ad Network

* Tribal Fusion (http://www.tribalfusion.com) is very selective and has an excellent reputation with advertisers and publishers alike. Don’t feel too bad if you get rejected by this network, as tribal fusion only accepts a handful of marquee sites that have extensive demographics. Like clockwork, these guys pay on time.

* Like Tribal Fusion, Gorilla Nation (http://www.gorillanation.com) has a strong reputation and is very selective. While they don’t have strong network pricing and fill-rate, they have an excellent track record for closing on high paying targeted advertisers for your site.

* Burst Media (http://www.burstmedia.com) is one of the most established networks in the industry. They are a good first start for most sites as they accept almost anybody. However, be aware that Burst penalizes non-exclusive sites and has a NET90 accounting rule. This means you have to wait 90 days after a campaign ends to receive your money, making your monthly cash-flow statements difficult to compute.

* Fast Click (http://www.fastclick.com) is the best ad network to get started with. They have quite a lot of inventory and ad space size options that makes it very easy to incorporate into your site. Their technology is the best of the networks and they make it simple to manage the ads they serve to your site. Like Tribal Fusion, Fast Click pays accurately and on-time each month.

* Google Ad Sense (http://www.google.com/adsense) lets publishers host Google AdWords placements. The financial return for publishers started out strong, prompting many webmasters to drop their ad networks. If you’d like to host text-only ads, this is the network for you.

Installing and Configuring phpAdsNew

phpAdsNew (http://www.phpAdsNew.com) is a LAMP-based advertising management, delivery, and reporting system developed and maintained by Niels Leenheer and Matteo Beccati. The latest version, 2.0, is available under the GPL, and is compatible with the latest versions of PHP and MySQL. (There is also a port to PostgreSQL for those that are interested.)

phpAdsNew supports banners, buttons, pop-ups, pop-unders, text, and Dynamic HTML ads, interstitials and others. You can also link different ad types together, like banner/pop-up hybrids, and even append headers and footers to each ad placement. With geographical targeting, advertiser accounts and reports, and third-party ad network integration capabilities, phpAdsNew is as robust as expensive proprietary platforms. phpAdsNew is also very robust and fast. phpAdsNew has been tested on sites serving over one million ad impressions per day on a single, dedicated, mid-range PHP and MySQL host. Linux clusters can be used to scale up for larger sites.

Installing phpAdsNew is quite easy, as it’s bundled with a helpful installer. Before delving into the installation, make sure you have a working Linux environment with Apache, PHP, mod_ssl, and MySQL. phpAdsNew works with PHP 4.0.3 and higher, and recommends running MySQL 3.23.2 or higher. To develop this article, the sample host ran Linux kernel 2.4.20-8, Apache 1.3.28, MySQL 4.0.14-standard, PHP 4.3.4, and mod_ssl 2.8.15-1.3.28 supported by OpenSSL 0.9.7a.

It’s highly recommended that you install SSL functionality into Apache to provide your administrator and advertisers the best security possible. Ensure SSL is properly installed and patched, and obtain and install a valid signed certificate from a widely recognized Certificate Authority (CA).

phpAdsNew also has some prerequisites: PHP’s track_ vars and file_uploads options must be turned on. If you plan on incorporating Macromedia Flash ads and want phpAdsNew to track click-throughs automatically, compile PHP with the ZLib extension. Also, phpAdsNew can also manage ads stored on a remote FTP server, so it’s a good idea to compile the FTP extension in PHP just in case you need it in the future.

The latest version of phpAdsNew can be retrieved from http://www.phpAdsNew.com. Download it to your server, un-tar the package in your web path, and rename the folder to adserver (or a name of your choosing), so that the URL for phpAdsNew will be something like http://www.your-host.com/adserver. Next, the administration system needs write access to the config.inc.php file in the adserver directory. Type chmod a+w config.inc.php in that directory.

To start the installer, open up a web browser and go to the phpAdsNew directory. If Apache and PHP are installed correctly, you should see a welcome message followed by a legal agreement page. If not, the installer should tell you what’s wrong. If you get a blank page, it’s more than likely PHP isn’t installed correctly.

Continuing the installation, you’ll encounter an administrator account screen where you should enter your information. For the URL of the phpAdsNew server, you’ll more than likely use http://www.your-host.com/adserver.

Next, you must create the database and specify the database information. The installer doesn’t create the database — you’ll need to create it and a MySQL username that has privileges to SELECT, INSERT, UPDATE, DELETE, and CREATE.

This completes the automatic installation, but there are a number of optional features and customizations you’ll likely want to edit. phpAdsNew has an administration area where you can edit various parameters. Login by browsing to http://www.your-host.com/adserver and entering the administration username and password you created above. Click on the “Settings” tab to further customize your installation. After you make your changes, make sure to lock your configuration file by running chmod a-w config.inc.php in your host’s adserver directory.

Before creating campaigns and other elements and adding advertisers to your system, you’ll need to complete one final configuration step. phpAdsNew uses an automatic maintenance script to activate campaigns, recalculate banner priorities, and distribute email reports. This script needs to run every hour, on the hour (or as close as possible), and never more than once per hour. The easiest way to schedule this maintenance script is through cron.

To run this maintenance script, you’ll need either curl, wget, fetch, or lynx. If you’re using curl, add the following to a local username’s crontab:

0 * * * * curl -s -o /dev/null

(The crontab entry shown above appears as three lines to fit the page, but should appear on a single line in the file.)

Exploring phpAdsNew

By now, you should have a fully working advertising management and delivery system. Let’s do some more configuration.

First, login to your phpAdsNew application and click on the “Settings” tab. On the top of the page, you should see a drop-down menu titled “Choose Section.” In the first section, “Database settings,” enable both Use persistent connections and Use delayed inserts to increase performance on your system. Change the section to “Invocation and delivery settings” and make sure Delivery cache type is set to Files. Change the top section to “Host information and Geotargeting” and make sure that the two options under the “Remote Host” heading are disabled.

Change the top section to “Statistics Settings.” There are a number of important items to consider on this page. For the statistics format, it’s a good idea to use the Compact format and to log the source parameter specified during invocation. Then scroll down to the bottom of this page and specify your pruning preference. In general, you should keep your statistics in the active database for at least 6 months. The other top settings sections allow you to control various aspects of the management interface, reporting behavior, and permissions.

Now that your installation has been customized to your needs, you’ll need to create advertising zones and install the invocation code for each zone on your site. Click on the “Inventory” tab on top of the page and then click on “Publishers and Zones.”

Within the page, you can setup any number of web sites and related zones for each web site you manage. Click on “Add new publisher” and fill out the form related to your site. You can then to create your first zone.

Again, complete the form on the page and use the size drop-down to set the zone for an IAerboard (728×90) banner. Save your changes and click on the “Invocation code” tab. This is the code you’ll need to install on your web pages to display your advertiser’s banner.

The “Remote invocation for JavaScript” is the method that is compatible with most browsers, is the fastest to render, and supports all rich-media assets including Flash, DHTML and third- party ad codes. Select that option and then click on the “Generate” button to get your ad code.

There are two important steps.

First, there is a bug in the JavaScript invocation code that prevents the ad space from rendering in some versions of Internet Explorer. To avoid this bug, append the following statements before the document.write (“‘><” + “/script>”); line in all of your JavaScript ad codes:

document.write (“s. _used” +
document.write (“s. _rand” + phpAds_random);

In addition, you should use the source tag option in your ad code. Using the source tag option allows you to use one ad zone for all of your pages, yet define multiple sub-sections within your site.

For example, if you run a web site with many subsections, you can specify the name of the subsection in the source tag to target advertising campaigns to a specific source within a zone. You can also report statistics based on zones to provide even more important information for the campaign.

And here’s a trick: generate the source value from a PHP variable to drill down into article-level tracking. For example, if you publish articles on your site and generate the article using a unique article ID, send the dynamically generated ID number as the source value to target ads directly to the article. This is how the big sites sell ads, and it’s now possible to do the same on your own site.

Now that you have deployed your first zone, click the “Inventory” tab again, then “Advertisers & Campaigns,” then “Add new advertiser.” Fill out the information on the following screen to create a sample advertiser and then continue on to create a new campaign.

If you’ve already been accepted by one of the ad networks listed above, you’ll want to set the contract information to be a default campaign with unlimited AdViews and AdClicks with no expiration date. For the priority, keep the campaign as a low priority, with a weight of 1. If you’ve sold your own ads, set the impression levels to high priority.

After you save your changes, you’ll be directed to the “Linked Zones” tab. Select the zone you’ve already created for the Leaderboard and save. You’ll then be prompted to create a new banner. For the ad network’s code, use the drop-down to select HTML banner and copy your ad networks code for the corresponding size in the text box. Make sure the set the size to Width: 728 and Height: 90, or else your banner won’t load in the zone.

After you save this screen, you can set other delivery options and geo-targeting based on your preference or contract. At this time, your ad should begin to display to visitors on your site.

Where to Go From Here?

As with any significant package, the next step is to read, study, and learn. There are two excellent PDF instruction manuals that come with your phpAdsNew installation. There is also an active support forum located at http://forum.phpAdsNew.com.

As for finding sponsors, that’s up to you. Don’t be surprised by the low revenue generated at first. Most of the ad networks want to make sure your traffic is “on the level,” and the return on their investment in you is agreeable before showing you some real ad dollars.

If you sign up for multiple ad networks, you’ll need to manage the multiple sources. See the sidebar “Managing Your Ads” for more details.

Managing Your Ads

Assuming that you want to spread the wealth and sign up with multiple ad networks (which is recommended), you must manage all of your ad sources to maximize revenue.

At first, you might prioritize all ad networks equally, giving each source the same amount of exposure — important because initial ads typically build a brand and are most likely to be clicked on. Over time, however, you might weight the sources differently, based on the effectiveness of each network and its revenue potential. Moreover, ads you sell directly are likely to earn more and should be delivered more frequently. With phpAdsNew, you can assign priorities to each campaign.

Preparing your site to serve advertising requires planning and some patience. For example, it’s hard to anticipate which size ads sponsor will want to buy. (The Interactive Advertising Bureau is an organization that establishes standards and practices for advertising units. Visit http://www.iab.com/standards/adunits.asp to review the common sizes advertisers use.) In a perfect world, you’d accommodate every request, but in practice, it’s very difficult to do.

Instead, start off offering a top horizontal placement, such as 728×90 Leader Board (which can also serve a smaller 468×60 Full Banner) and an in-content 300×250 Medium Rectangle. These two placements are the most popular with reputable ad networks and advertisers.

The most important factor in making online ad sales effective is your own level of commitment and involvement. No one is better equipped to sell your mission and who knows your visitors than you. Happy hunting!

Michael Bordash manages and sells his own ads for InternetDJ. com. Michael can be reached at mbordash@internetdj.com.

Comments are closed.