How To: Use Adsense Section Targeting with Thesis

There are dozens of ways that people make money with their website. None is easier than using Google Adsense, even if it’s not always the most profitable.

When using Adsense, it’s important to use a feature called Section Targeting. Basically that means you get to define the area that Google uses for context when it displays ads. Normally you’ll just insert two lines of code into your single.php template – one before the post, and one after.

Since you’re using Thesis (And seriously, haven’t I convinced you to switch yet?), you can’t go hacking the Thesis core – that’s a big no-no. Instead, you can just insert this block of code into your custom_functions.php file.

//Adsense Section Targeting
function start_adsense_targeting(){
echo “<!– google_ad_section_start –>”;
}
function finish_adsense_targeting(){
echo “<!– google_ad_section_end –>”;
}
add_action(‘thesis_hook_before_headline’,'start_adsense_targeting’ );
add_action(‘thesis_hook_after_post’, ‘finish_adsense_targeting’);

The reason I recommend using the thesis_hook_before_headline hook rather than the thesis_hook_before_post hook is that my method includes the post title in the section targeting.  Since your headline is very likely to be keyword-rich, why not include it to target your ads better?

That’s it. One little tiny block of code, and your Adsense ads will be much better targeted to your content. The end result? More relevant ads, more clicks, and more money in your pocket.


Get Free Updates

If you enjoyed this article, you will definitely enjoy our others. Subscribe to the feed to get instantly updated for those awesome articles soon to come.

Share this article:

Comments on this entry are closed.

Previous post:

Next post: