February 14, 2006

Chitika Tip #2

My original Chitika Tip is pretty dated. Today I’m using a slightly better and cleaner method of targetting the Chitika ads to the content of my blog posts, and this is made all the easier thanks to their new default category.

Though it’s still not ideal, here is what I’m doing in the code now:

var ch_queries = new Array( “<?php the_title(); ?>”, “<?php $cat = get_the_category(); $cat = $cat[0]; echo $cat->cat_name; ?>” );

What this accomplishes:

The keywords for the Chitika block is the name of the post itself and then the first category that the post is filed under. This is a lot cleaner than my original approach of inclosing two Chitika blocks inside of an If / Else statement.

Why this isn’t as good as it could be is because I don’t know how to gather all of the categories that the post may be filed under and then consequently pass each of those categories as a keyword. The end result is that only one category is used as a keyword.

Still, you at least get the post title as the first keyword and then the category that it’s filed under as a secondary keyword. This prevents the ad from being contextual and thus it won’t break one of the requirements of the ToS to certain contextual advertisement systems.

We also have a nice fall back beyond this thanks to Chitika’s new default category. For the last several days I’ve been running the Seasonal category which, of course, has been running Valentine’s Day ads. Thus, if Chitika can’t find anything related to either of my keywords then it doesn’t fall back to a contextual system. Instead, it falls back onto its default category. If it still can’t find anything then it just gives up and chooses a random popular item from its database.

In all it’s not a bad system. I am obviously not a coder or I would have a much better approach, but it can work rather well for those of us who need a simple approach specifically because we’re not coders. For an example of one of the better results that I get from this method take a look at the Chitika block on my pet supplies search plugin post.

On some of the other plugin posts it can’t find any ads based on the post’s title, so it falls back onto the category keyword. That’s “Firefox Search Plugins”. Unfortunately the term Firefox seems to trigger rather technical advertisements that have nothing to do with the post itself.

The end result? A much cleaner approach than my previous method for targetting the Chitika block to the current post. It isn’t much, but I like to share what ideas I can.

This of course all assumes that you’re running Wordpress and that you’re placing the Chitika code inside of the template rather than using a plugin. For whatever reason.

~Steph

Technorati Tags: ,


Topics: Waste Basket |

Comments are closed.