I recently added Chitika eMiniMalls to Slaptijack. Since it is a violation of the Google AdSense Terms & Conditions to have other contextual ads along side Google ads, I was forced to use non-contextual ads.
Chitika eMiniMalls has a wide selection of categories that you can choose from to narrow down the selection of ads it sends your readers. Unfortunately, this means hard-coding a category, and I didn’t think readers of my TCP Performance Tuning series (a series of articles related to server performance) would want to see ads for routers.
That’s when I was hit with a stroke of genius. Instead of using one category for the entire site, I decided to use the default category and then add a query to the ad based on the category of the article being displayed. This means that an article posted in “Networking” displays routers and USB Ethernet adapters, while an article in “Graphics Design” displays ads for Adobe Photoshop.
In order to get the category from the post, the
<!-- Chitika eMiniMall ad setup (in The Loop) -->
ch_client = "???"; // Your ID goes here.
ch_width = 300;
ch_height = 250;
ch_non_contextual = 1;
ch_nosearch = 1 ;
ch_query = <?php $cat = get_the_category(); $cat_name = $cat->cat_name; echo "'$cat_name'"; ?>;
Perfect. The code that places the ad can go anywhere. For example on Slaptijack, I’ve currently got the code that places the ad in my sidebar (thus, outside the loop).
Nothing special there, just the usual stuff. Anyway, that’s what I did. Good luck!