If you’re a Webmaster, and haven’t signed up for AuctionAds yet, you should. Basically it is an advertising network for the eBay affiliate program: The AuctionAds advertisement shows an item listed on eBay, if one of your viewers click on the ad and end up buying that item, you get a commission.
There is one problem with AuctionAds though. And that is, unlike Google Adsense’s ability to “read” the page and present contextual and relevant ads, AuctionAds has a “simple” parameter where you must enter keywords. So if you want AuctionAds to show Cell Phone listings on eBay, you need to enter “Cell Phone” into that field. While it allows the webmaster an ability to “focus” the ad, it’s rather tedious… you can’t enter one code, and expect that the ad will always be relevant. Maybe if your website was just about Cell Phones, that’d be cool. But if, for example, you’re using on a general blog where you post about a variety of topics, there’s no “simple” way to make the ad relevant.
To that end, I’ve written some simple code to work around that deficiency…
In single.php, find:
<?php the_content(); ?>
And add this above it:
<?php $catname = ”; foreach((get_the_category()) as $cat) { $catname = $catname . $cat->cat_name . ‘,’; } $catname = rtrim($catname,’,'); ?> <script type=”text/javascript”><!– auctionads_ad_kw = “<?php echo $catname; ?>”; … your auctionads parameters … –></script> <script type=”text/javascript” src=”http://ads.auctionads.com/pagead/show_ads.js”> <script>
What the code does is:
This is what I learnt today! Hopefully it’ll be of use to others