A Widget / shortcode plugin to display Google Affiliate Network ads.
Both text links and image ads can be displayed. The widgets are
parameterized. There is backend access to the database table of links.
Links can be added and/or edited by hand or can be added in bulk from a
Tab Separate Value file, as downloaded from Links (Beta) tab from the
Google Affiliate Network page. A Tcl script is included to insert
E-Mailed links (link subscriptions). The Widgets and shortcodes are
parameterized for both sidebar display (vertical layout) as well as
leader/footer display (horizontal layout).
The ads are rotated, with the least viewed ads from the lest viewed
avertisers being shown in preference to ads that have been viewed more
from avertisers than have been viewed more. As ads are displayed,
their impression counts are incremented, which moves such ads to the
back of the list. Ads are displayed in iframes, which keeps the ads
contained on the page. Either widgets can be used to display ads in
side bars or shortcodes can be used to display ads in pages or posts
(both can be used if desired). A given ad unit can only display text or
image ads, not both. As a convience, a media insert button is available
on the post and page editor to generate and insert short codes to
display ad units on posts and pages.
The plugin provides an administration page to view the database of ads,
with the ability to add ads one at a time or in bulk (from a TSV file
downloaded from your Google Affiliate Network Links tab). There are
also administration pages to view ad impression statistics and merchant
(advertiser) impression statistics. The statistics can be downloaded as
CSV files. The plugin also includes a help page and a printable PDF
Notice: Google is planning on retiring the Google Affiliate Network. I am
going to stop working on this code. It is available for whoever wants to look
at it and maybe use it as example code or the basis of some other affiliate
Unpack the plugin archive under the wp-content/plugins directory and
then activate the plugin.
You can then add the widgets to your sidebar(s) and start adding in
links with the database manager. You can also use the shortcodes to
insert ad frames into posts or pages (you can use the Insert Ad Unit
media button to generate and insert these short codes). There is a help
page and a printable PDF user manual, that explains how to put ads in
the database and how to display ads on your blog pages or posts.
The link subscription handling script should be copied somewhere and
edited as needed (database access information). You’ll need to have Tcl
and mysqltcl installed. You will also need procmail (almost all Linux
system use procmail for their local mail delivery agent). Read the
ganlinksToDB.tcl file carefully.
A downloadable PDF user manual is available at gan_manual.pdf.
This manual provides detailed documentation on how to use this plugin.