Sponsor Ad Management User Guide



Default Options

The default options define the purchase URL and the alt/title tag text for use with the default ads you specified for each zone.

Default Purchase Ad URI
Enter the URL to the page where you accept ad orders. The cd_ad_sponsor plug-in does not process orders or payments.
Default Alt/Title Tag
Enter the alt/title tag text used for the default ads you defined in the Manage Zones section. This entry should indicate to the visitor that they will be re-directed to the purchase page. An example entry might be, "Advertise with us.", or similar.
[Version 1.1, 11-09-2009] Clear Clickthrough Counts
Some search engine crawlers, such as googlebot, may trigger invalid clickthrough counts. The Default Options page allows you to set whether search engine crawler click counts should automatically be removed from the clickthrough table. You can manually clear click counts from the Manage Excluded IP page as well.
[Version 1.2.4, 02-02-2010] Notify Days
An administrative email notice is sent when an ad is expiring within the number of days specified.

Excluded IPs

Excluded IPs are compared to the user IP address to determine whether a click-through is registered for a Sponsor Ad. This exclusion is necessary to prevent false clicks, such as when the site administrator tests a displayed ad link. This feature is provided to accurately track CPC and CPM statistics in the cd_ad_sponsor plugin only.

[Version 1.1, 11-09-2009]

  • The Manage Excluded IP page displays the host name associated with each listed IP address.
  • You can delete an IP address from the excluded IP table.
  • You can manually clear search engine crawler counts from the clickthrough table.

If you are using WordPressµ, the Excluded IPs you define apply to the currently active blog only.

Excluded IPs have no bearing on those sponsor programs that also acquire the source IP. This means that sponsor programs, such as Google AdSense will still register your IP and may determine that a specific click is not valid.

Excluded IP Address
Enter a valid IP address to exclude.
Description
Enter a description for this IP address. For example, Primary workstation, or Sales Department, etc.

After you are satisfied with your entries, click Save Changes. The Manage Excluded IP page is displayed with your new excluded data.

To edit an excluded IP, click the IP address.

Banner Report

[Version 1.2.1, 12-07-2009]
The Banner Report page provides an overview of the current performance of each ad. This report lists each Banner Ad, grouped by Sponsor, the schedule dates, the click-through counts, impressions, and the ratio of clicks to impressions. The rate column indicates the currently assigned Revenue Type and the amount earned to date. You may also select those banner ads which have click-through counts to view an itemized report click-through report.


Only those ads that have click-through counts are available for the itemized report. The itemized report lists all click-through counts, the date/time stamp for each click, and the click originator's IP address. You can also view the Whois data for each IP address to help determine whether you want to include the IP address in the Excluded IP table.

Note: When you add a visitor IP address to the Excluded IP table, that IP address is removed from the click-through counts.

Uninstall

[Version 1.2.3, 01-30-2010]
The uninstall feature will completely remove the cd_ad_sponsor tables from your WordPress installation.

CAUTION I strongly recommend that you backup your database files before you attempt to uninstall the cd_ad_sponsor plug-in.

This completes the sponsor ad definitions. You should now have a complete list of your sponsors, and their associated programs and revenue types. You should also have a complete list of zones, banner ads, and have defined your schedules. If you have not defined all of this information, you should go back and enter any missing data.

Modifying Your Theme

Now that you have defined your sponsor ad data, we'll modify the theme to use this information. In order to enable the placement of your ads, you need to insert a simple function call at the appropriate position within each of the theme files where you want the ads presented. Refer to our layout sketch to track the changes we make to the theme files.

The syntax for the function call looks like this.

<?php
if (function_exists('cd_ad_zone')) {
   cd_ad_zone(zone_id);
}
?>

Note: It is always a good idea to place any function call within a conditional statement to determine if the function is available. If the function is available, then it will be executed when WordPress processes this file. If it is not present, then it will simply be skipped without causing an error.

The function name is cd_ad_zone(zone_id). You replace zone_id with the numeric zone identifier you specified when you created the zone.


We'll start off with the header.php file. Open the header.php with a text editor. Since we want our header ad (zone 1) positioned next to the logo, we need to locate the code that refers to the header text. In the default WordPress theme, this looks like the following.

<div id="header" role="banner">
   <div id="headerimg">
      <h1><a href="<?php echo get_option('home'); ?>/">
         <?php bloginfo('name'); ?></a></h1>
      <div class="description"><?php bloginfo('description'); ?></div>
   </div>
</div>

We need to place our function call inside the <div id="header"> tag just before its closing </div> tag. We place our function call there so that we won't interfere with the normal layout of the theme. The modified file now looks like this.

<div id="header" role="banner">
   <div id="headerimg">
      <h1><a href="<?php echo get_option('home'); ?>/">
         <?php bloginfo('name'); ?></a></h1>
      <div class="description"><?php bloginfo('description'); ?></div>
   </div>
<?php
if (function_exists('cd_ad_zone')) {
   cd_ad_zone( 1 );
}
?>
</div>

That's all that needs to be done to the header.php file, so save the changes and upload the file to your server. Access your blog URL to view the changes. If all went well with the definitions you should see PSACentral banner ad displayed in the header.

The next zone we need to define from our sketch is for zone 5, the sidebar zone defined for our Google ad. Open the sidebar.php file with a text editor. Take a moment to browse through the code so that you become familiar with the different elements and their positioning. what we need to look for is a location within the sidebar file to insert our function call.

As an example, let's say that the sidebar contains a listing of our blog categories, followed by a listing of archives, and finally a listing of links. Let's put our zone 5 function call between the archive and link listings, like so.


</div>

<?php
if (function_exists('cd_ad_zone')) {
   cd_ad_zone( 5 );
}
?>

<div class="Block">

Save the changes and upload the sidebar file to your server. Access your blog URL to view the changes. If all went well with the definitions you should see the Google ad displayed in the sidebar between the archive and link listings.

Embedding Ads Between Excerpts

One other modification you may want to make to your theme files is the ability to embed ads between excerpts. For example, let's say our index page displays ten excerpts per page, and we want to present an ad between every fourth excerpt. According to our sketch, this zone is identified as 3.

Note: Do not confuse embedding ads between excerpts with embedding ads between paragraphs inside a post. I will explain embedding ads within each post later in this article.


To enable embedding ads, open the index.php file and locate the following line(s) of code. Depending upon your theme, your code may look slightly different. Regardless, the following code elements will be present.

<?php if (have_posts()) : ?>
if (while (have_posts()) : the_post(); ?>

What we need to do is insert and initalize a counter variable immediately after the have_post() function and before the while statement, like so.

<?php if (have_posts())  : $adCounter = 0; ?>
if (while (have_posts()) : the_post(); ?>

Before we ad our function call, we need to test whether our ad counter is equal to the desired value. If it is only then do we execute our function call. Otherwise, we skip over the function and allow WordPress to continue processing the excerpts. This code must be placed immediately before the endwhile statement. Here is what that looks like.

<?php
$adCounter++;
if ($adCounter == 4) {
   if (function_exists('cd_ad_zone')) {
      cd_ad_zone(3);
      $adCounter = 0;
   }
}
?>
<?php endwhile; ?>

Each time WordPress processes an excerpt, the counter is incremented by one. When and if the counter value is equal to 4, we execute our function call for zone 3. If we did execute our function call, we need to reset the ad counter so that it starts over from zero. You can change the value of the ad counter test to some other value than 4. The value simply means that an ad may be placed between every nth excerpt.

Embedding Ads within Posts

The cd_ad_sponsor plug-in allows you to automatically insert sponsor ads within your post articles at a specified frequency without intervention by your authors. This means that your authors do not have to manually insert special tags or other identifiers within their posts in order to display your sponsor ads.

Remember the previous cautionary note that one, and only one, zone may have a frequency value greater than zero.

There is no special function call to insert in your theme. The cd_ad_sponsor plug-in looks at each post automatically to locate the desired position (Ad Frequency setting) in which to insert a sponsor ad. Depending upon the length of your posts, you should define sufficient banner ads to insert based upon your Ad Frequency setting. For example, if you have a post of eight paragraphs, and an Ad Frequency value of 2, then you should have at least four sponsor ads defined for this zone. The cd_ad_sponsor plug-in will insert a sponsor ads between every 2nd paragraph.

[Version 1.3.0, 02-20-2010]
I have added a post tag to optionally omit banner ads from displaying within certain posts. Simply add the following tag to the beginning of your post or page.


<!--cd_ad_none-->

Miscellaneous

This section describes general aspects of the cd_ad_sponsor plug-in.

Footer.php Action Hook

One piece of code that should be included with your theme, but is not required, is the action hook, wp_footer(). Most theme developers, however, do include this hook in the footer.php file. Personally, this hook should be required for all themes. Since it is optional, you need to add it to your footer.php file if it does not already exist. The cd_ad_sponsor plug-in uses this hook to reset the database table of banner ads that have been displayed.

[Version 1.1, 11-09-2009]
If you set the Clear Clickthrough Counts option on the Default Options page, then the clickthrough counts are cleared for each IP listed on the Manage Excluded IP page.

Verify that the following code is toward the end of your footer.php file.

<?php wp_footer(); ?>

Banner Ad Folders

The cd_ad_sponsor plug-in does not upload banner images for you. This means that you will need to manually create the folder structure that fits your site. For example, I have a folder for each sponsor, and sub folders for each of their sites and products. It wasn't necessary for me to create a file management plug-in as it was just as easy to FTP the banner images to the appropriate folders.

Why Can't I Delete An Entry?

There are two reasons I did not include a delete function, orphans and usability. If you delete a sponsor, for example, then any program, banner, revenue type, and schedule would now be orphaned. That is, the parent reference would no longer exist, and those data would no longer be accessible. I could have incorporated a delete function, but you could very easily destroy a lot of configuration information that you spent a lot of time creating. For the few times it would ever be necessary, it is more efficient to overwrite an undesirable entry with updated information.

Pages: 1 2 3 4

21 Responses to “Sponsor Ad Management User Guide”

  • Coyote says:

    Hello Jean-Marc,

    I am already working on your feature request for the next release. Actually, I am not really happy with the way WP handles user names and passwords so I am creating an export function to pull a sponsor report that can later be emailed to individual sponsors. It is a little simpler than managing sponsor log ins.

    I sent you an email.

    Thank for your input!
    Coyote

  • marcus says:

    Hello,

    This plugin looks dynomite! I had no problem installing and configuring it but for some reason the target url for each banner either defaults to the default setting or to the category landing page of the category I've selected that banner to display in. Anyone else experiencing this or have input as to what I may have configured incorrectly?

    Thanks!
    Mark

  • Coyote says:

    Hi Mark,

    It sounds as if you have a minor config issue. I will be more than happy to help.

    Do you have skype? If so, you can contact me at, coyotesdesigns. It would be much easier to check your configuration in an almost real-time chat vs. emailin' back and forth.

  • flyboy says:

    This plugin is unbelievably cool!

    Question though... Is there way to delete a sponsors/banner/zones etc. in the admin interface? Seems this could get seriously out of hand after a few months.

    Thanks, Coyote.

  • Coyote says:

    Hello flyboy,

    Thanks! I appreciate your comments.

    I did not code a delete function for two reasons, 1) It was not necessary for my needs, and 2) The relationships would cause a major headache for users. For example, deleting a sponsor would also require removing the associated program types, the associated banners, and any scheduled ads. I found it simpler for the user to edit an existing entry to include the desired data.

    I do think that a delete function is viable. I am currently working on a reporting feature, which may necessitate an archival feature instead, or in addition to, a delete function. There are merits to both.

    Please let me know if you have any questions.

    Sincerely,
    Coyote

  • candys says:

    Wow, plugin looks perfect but I receive an error when I try to create a sponsor. Have reinstalled twice and made sure all files are writable. Any ideas?

  • Coyote says:

    Hello candys,

    If you will be so kind as to forward the exact error message to me, coyote [at] coyotesdesigns [dot] com, I will be more than happy to assist you.

    [EDIT]
    I have release version 1.2.4 to correct an error during new installs where the database tables were not created. I sincerely apologize for this oversight.
    You can download the plug-in from the downloads page on this site, or from the WordPress plugins page.
    [/EDIT]

    Best regards,
    Coyote

  • candys says:

    Thx, did the trick.

  • roefie says:

    I've installed and activate this plugin but I can't add sponsors.
    The following message is displayed after add sponsor:
    "You do not have sufficient permissions to access this page."

    What is the solution for this problem?

    Thanks in advance.

  • Coyote says:

    Hi,

    You should be logged in as administrator. What version of WP/PHP are you running? You can contact me on skype, coyotesdesigns, if you are still having difficulties and I will do my best to assist you.

    ~Coyote


Popular Posts

Quote of the day plugin

The Quote Of The Day plug-in manages quotes displayed on your WordPress or WordPressµ

Sponsor Ad Management User Guide

The cd_ad_sponsor plug-in was written to manage the sponsor ads that can be presented with

A WordPress Sponsor Ad Management Plug-In

I wrote the WordPress Sponsor Ad Management Plug-in to use within the WordPress and WordPr

Quote Of The Day
An ecstasy is a thing that will not go into words; it feels like music, and one cannot tell about music so that another person can get the feeling of it.
~Mark Twain