Using Adsense on your blog usually isn’t the most profitable way to monetize it, but it is fairly quick and easy, which makes it a popular choice for many website owners. Last week I moved one of my commercial blogs to Thesis, and was reminded of the importance of using section targeting on your blog.
Section targeting is an adsense approved method of telling the ad serving algorithm which parts of your websites to pay attention to and which parts to ignore. Because blogs sometimes have a lot of extraneous info, non essential keywords, or low profit keywords on them, Adsense isn’t always as profitable as it could be. However by telling Adsense to use only the contents of the post for determining which ads to show AND (that’s a big and) putting the ads in that section, you usually get the combination of on target ads that are going to generate the most profit.
Is section targeting worth doing … the graph below shows Adsense CPM for the month of February, the three days in the box are the days the blog didn’t have section targeting enabled.

Once the section targeting was added back in you can see the earnings returned to normal. I’m pretty sure you aren’t allowed to show actual dollar amounts, CPM, or CTR rates from your Adsense account, but since this is sanitized I think I’m ok.
Now on to the real part of the tutorial, we’re going to be using hooks to add Adsense section targeting. If you aren’t familiar with how to add thesis hooks, you should read Thesis Tutorial – Hooks for Dummies.
Inside of your custom_functions.php file you want to add the following code:
//adsense targeting functions
function open_adsense_targting(){
echo "<!-- google_ad_section_start -->";
}
function close_adsense_targting(){
echo "<!-- google_ad_section_end -->";
}
That adds the functions to open and close the section targeting tags. You could use shorter names but I’m a big proponent of easy to understand programming, and if you come back 6 months from now it’s going to be really easy to tell what that programming is and what it’s used for.
Next we need this code:
add_action('thesis_hook_before_post','open_adsense_targting' );
add_action('thesis_hook_after_post', 'close_adsense_targting');
This uses the hook locations to tell it to open the tag before the post and close the tag after the post. If you are looking for a list of all hooks here’s a nice reference. That’s it that’s all there is to it.
I’m a big proponent of thesis, and and am going to move my blog onto it as soon as I stop being so lazy busy. The real benefit of thesis is it acts like a management layer for your design, so you don’t have to go into the template files to make your changes. You don’t have to worry about messing up and breaking tinkering with core wordpress functions. It also makes it easy and painless for people who aren’t exceptionally skilled with programming to make changes. If you do know your way around the code it just makes it easier to get things done. It’s $87 for a personal copy or $164 for the developers license (which for me was a no brainer) if you were thinking of buying it feel free to use my thesis aff link
or you can go straight.
Thesis has an incredibly powerful and helpful community of supporters so it’s something I have no problem reccomending.
Related posts:
- Thesis Tutorial – Adding Date Based Triggers to Your Posts There are a lot of times when you are working...
- How to Add a Carousel to Your Thesis Blog If you’ve spent any time visiting blogs lately chances are...
- How to Add a Visual Slider to Thesis The following is a tutorial on how to add a...











{ 21 comments }
Hi, good to be reminded of the importance of section targeting – but do you really need to add functions to get it rolling? I’ve always just dumped the ad_section_start/end tags on either side of the content in the single page template?
that’s how thesis works, you create the functions and tell it where to put them, you NEVER EVER touch the core files. I was really skeptical that it was actually better in the beginning, but now I totally see the benefits.
MG
Your affiliate link didn’t work. Hope that’s not affecting all of your link redirects from the /go/ folder.
“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 5 on line: 2659″
Cheers,
E.
thanks, weird it works for me but no one else, sometimes i hate plugins …
Make sense, thank you
*Works
Nice post. One question: the final result I get is:
- adsense code
- adsense start tag
post
- adsense close tag
-adesense code
Do both adsense codes need to be between the tags? or it doesn’t matter?
Thanks
I don’t think it matters, but I’ve never tried it that way
I prefer to use before_content and after_content, which brings in the post title and comments respectively. If you want the post title included but do not want the comments included then you could use before_content and after_post.
if you do you have to make sure your titles are KWD focused not “clever and witty”
I have Thesis and LOVE it. I’d just like to add that if you do use it, you should then install Rick Beckman’s Thesis Open Hook plug-in, as you can then add the hooks you want directly into a plug-in, without going into the template. An even more graceful and sophisticated solution for a graceful and sophisticated theme.
First time here and a really informative post and site in general. The link to section targeting seems broken and I’m kind of a noob so would really like to learn more about it.
Thanks!
weird try it now
I have been using adsense for years now, but never knew about section targeting
Good information here, I don’t use thesis on my sites and they are hand-coded but I will definitely try this on a blog and see if improves the kind of advertisements that are shown on my blog.
This is a great tip!
Is there any way to check that I installed it correctly? I’m relatively code-illiterate.
Thanks for the great info!
View source after you are done and look for the open and close tags. Make sure you turn off any caching software like WP-Cache
Thanks Michael! Looks like I did it right, thanks to your fabulous instructions.
Erin
I added these lines to my custom functions file.
I will definitely be keeping an eye on my eCPM during the next few days.
Just wanted to say thank you! That was a perfect tutorial.
its to know how to add adsense for better place so we can gain much benefit and of course we can gain much money.thank you very much
I stqand with you bro! People need to find things fast. Any help to make their job easier will make them more contented.
Thanks for this–I need to get better returns on Adsense ads.
Comments on this entry are closed.