27 Adsense beneath Blogger post titles or at end of posts

A key placement of AdSense is within the body of a blog post. You can easily feature ad units beneath every post title or at the end of each post by adding AdSense code to your templates HTML. Here's what to do to achieve this.

  1. Log into your AdSense control panel and choose the ad unit you would like to be displayed. Be sure to keep the width of your posts in mind: some are wide enough to feature a 468x60px banner, while others may be restricted to the half-banner width of 234px.
  2. Copy the code and paste into a text editor (such as Notepad). You'll need to change some of the characters in this code in order for it to display in your blog. Don't worry, this doesn't contravene Google's T&C's for AdSense, as I'll explain later.
  3. Your code will look something like this: You'll need to change the < and > in red to the following:
    < = &lt ; > = &gt ;
  4. Now, log in to your Blogger dashboard and go to Template>Edit HTML, and tick the "Expand widget templates" box. Ensure that you backup your template before making any changes.
  5. Find this section of code using the search function of your browser (usually CTRL+F):
    <p><data:post.body/></p>
  6. To feature ads immediately after your post titles, insert your AdSense code just before this section in your template. To feature ads at the end of every post, paste the code immediately after instead.
  7. Save your template to see the ads in action!

Do be aware that if there are more than 3 ad units on a page, not all of the ads will be displayed; if you feature a number of ads on your main Blogger page, ads will not display in all of the posts, though they should be displayed on the post pages.

As I mentioned earlier, modifying the AdSense code in the way I have described will not contravene AdSense terms and conditions: all you are doing is substituting the < and > for the HTML encoding for these characters. When you look at the source code for the page, the AdSense code will display as it was originally written. This modification will not alter the functionality of the code at all, and ensures that it will be displayed. The code as first presented will not display in the body of Blogger posts!

For examples of how this code should be implemented into your blog template, take a look at this page (opens in a new window).

Next: How to display ads in the body of the post itself.

Technorati Tags:

27 Comments:

5 July 2007 16:59
Anonymous said...

You'll need to change the <> in bold to the following: < = & lt; > = & gt;

There is nothing in the code that is highlighted in Bold. Deeply appreciate some clarification

5 July 2007 17:25 Amanda said...

My apologies, Anonymous! I'd written the post in HTML and had forgotten that Blogger needs different tags to make text bold! But for some reason, it still wont display as bold, so I've highlighted the characters in red instead. I've also modified the < and > as I'd made spaces which shouldn't be there. Hope this clarifies things for you. Feel free to email me if you need further help :)

5 July 2007 17:43
Anonymous said...

Thanks Amanda for your prompt reply. I've tried to replace the code but keep getting errors. It will be great if you can show what's the code like before as well as after the code is modified. Deeply appreciate a reply

5 July 2007 23:18 Amanda said...

Hello Anonymous,

I've written up examples of the code implementation in a separate page so as not to clutter this post with code. The link is near the bottom of the post above. I hope this helps you insert your Adsense code into your posts. BTW, what error messages are you getting when trying to insert the code? If you're still having problems, it may help if you let me know what this is.

6 July 2007 01:12
Anonymous said...

Hi Amanda

You've been an awesome help. Thank you for your time and awesome assistance. Really love your website. Will definitely refer your website to my friends.

24 July 2007 23:35 CrazyKinux said...

This post was a blessing! I've been looking for this for so long.

Thanks a lot for the post, this workaround, and the gold mine your blog is!

25 July 2007 18:07
Anonymous said...

HI amanda,

Nice blog,but am getting this error.

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The reference to entity "lt" must end with the ';' delimiter.

28 July 2007 18:59 Amanda said...

@Crazykinux: Thanks for your comments, I'm really glad these hacks work so well for you :)

@Anonymous: I think there must be an unnescessary space between your "< ;" (possibly the closing > ; too). I had to write it this way in order to get this comment to show without substituting the code for the HTML characters! Try deleting the spaces and see if this works for you. If you still have problems, send me an email and I'll mail you the code in text form for you to copy and paste into yout template.

18 March 2008 03:52 eblogtemplates said...

Hi Amanda-

Great post! I've actually built a javascript ad code converter which will automatically replace the < and > characters (and also quotes and &) for this exact purpose. You should check it out!

Blogger Ad Code Converter

Thanks,

David

19 March 2008 09:21 Amanda said...

Thank you for letting us know about this, David :) I'll be sure to check it out.

24 March 2008 15:11 Rajeev Edmonds said...

Thanks Amanda, I was looking for this trick to show Adsense Ads at bottom of my posts. It's working smooth.

I have chosen the option of showing ad only when individual post is opened. For home page I do not show ad at bottom of every post.

Thanks.

26 June 2008 16:32 YuLianto1993 said...

Amanda could you help me ? I had an error message like this "Your template could not be parsed as it is not well-formed. Please make sure that all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed character data or markup". May be I should send you my template html and please do for me.Honestly I don't understand html.

24 July 2008 21:52 eCreativa Media said...

Thanks for the idiot-proof explanation. I was able to implement it on my blog without any problem. I was able to tweak this code a bit to post them on the left.

5 August 2008 17:45 Jane said...

Hi Amanda,

First of all, I love your site! It's very neat and professional, and your explanations are very clear.

However, I'm also getting the same error as YuLianto. I have tried clicking on the example of the code implementation, but there's an error with that page.

Would appreciate your help!

5 August 2008 18:07 Amanda said...

@Jane: I'm sorry that the example code page is not working. I haven;t deleted this, and can only expect it is a problem with my hosting.

In the meantime, you may want to take a look at the source code of this page to see how Adsense works in the Blogger template code.

In the source code, the &lt; parts will appear like this: <. But I hope this will give you an idea of how the code should appear in your template.

The "Your template could not be parsed" error usually happens when using incomplete code or when accidentally deleting a character or two of code from your template.

If you're still experiencing problems, please email me a copy of your template code and I will help you add the code.

5 September 2008 19:27
Anonymous said...

Adı : Sibel Yapal
İL : Tokat
İlçe: Reşadiye.
D.Tarihi : 1980
Cinsel Tercihim : Lezbiyen
Benim gibi düşünen Yirmi otuz yaş arası bayanlarla tanışmak istiyorum.

4 October 2008 23:36 Tonio said...

Use the blogger template for adsense. It works great. Download it here

8 January 2009 18:08 Nancy Beck said...

What a great tip - it *finally* worked for me after I figured out that I needed to include the semicolons. I, too, kept getting that parsing error message until I inserted the semicolon after each code thingie.

Thanks for the tip! :-)

11 January 2009 12:50 ALLAL said...

Hi Amanda,

First THANKS a lot for you.

I had the same error & I have the solution.

We need to clear our cahe.

In Firefox:

1. click on the Tools menu and select Clear Private Data. Or (Ctrl+Shift+Dell).
2. remove the "checks" from everything except Cache (Cache has to be "checked")
3. click on Clear Private Data Now (on the bottom)

In Internet Explorer:

1. click on the Tools menu and select Internet Options
2. click on General tab
3. under Browsing History click on Delete
4. when the window pops up, click Delete Files in the Temporary Internet Files section

In Opera:

1. click on Tools menu and click Delete Private Data
2. click on the Details
3. remove "checks" from Delete cookies, Saved passwords (and others you don't want to delete)
4. click on Delete

In Safari:

1. click the Safari Menu and select Empty Cache
2. when the window pops up, click on Empty

In Chrome:

1. select the tools menu (the spanner,wrench icon) in the upper-right corner
2. click on the Clear Browsing data
3. click on the Empty the cache check box. Remove the "checks" from the things you don't want to delete (like Cookies, History...)
4. from Period drop-down menu, select the one. If you don't know what to choose, click on the Everything
5. click on the Clear Browsing Data

In Konqueror:

1. click on Settings and select Configure Konqueror
2. scroll down and select Cache
3. click on Clear Cache

Or visit this blog:

http://pocket-templates.blogspot.com/2008/12/clear-your-cache-how-to.html

Then we need to change our code Adsense:

You'll need to change the < and > and " to the following:

< = <
> = >
" = "

Now, your code it will be as below;

<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxx";
google_ad_slot = "yyyyyyyyyy";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script
src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>

Good luck!!!

19 February 2009 22:50 Fred said...

Hello,
Thanks for your useful tips, this blog is really amazing!
I already have a blog and use an Adsense account with some banners on top, left column, ect... but I didn't have any between my posts. I discovered this option when editing the design of the blog posts on Blogger. I am using text links each 2 posts.
What do you think is the best for use, your way adding the code directly to the template or using the Blogger option?
Do they pay the same? because I have notice that since I am using this blogger option , the clicks pay less
Sincerly,

Fred.

15 March 2009 21:18 Analekto said...

Hi,
Thanks for the tip that was my first step into embedding adsense in my blog. In case anyone is interested I have documented a method to add two ad units anywhere in the new blogger post body. You can read it here

29 April 2009 14:49 john said...

Adsense always takes new steps for its publishers.

8 May 2009 08:04
Anonymous said...

Amanda, Please help me, i want my adsense appear just in single post, not home and archieve. Adsen limit just 3 ads unit, when I click archieve/label post, there are blank space in the fourth post. How to fix the problem?

11 July 2009 08:27 investors times said...

I find this post quite interesting. I have been tring to place a widget in the post. Keep the hsrd work

21 July 2009 14:54 ali said...

Adsense keeps on making changes.

2 September 2009 07:37 Adebajo Opeoluwa said...

hello

i really don't understand how to go about this ...i want to place a text link at the end of each post i make...and i don't understand what you mean by this "and" pls i need more clarification on this...my blogsite....is "www.diabetic-coma.blogspot.com"...moreso google is showing irrelivant ads on ma site...is there anyway you can help me on this...

3 February 2010 12:32 New Digits said...

Just replacing the starting '<'and ending '>'with codes given works for me.
the following link will help u
http://www.eblogtemplates.com/blogger-ad-code-converter/

Post a Comment

Browse through the Archives

All existing posts are still available to view while I'm working on the site, albeit seen in a much simpler interface. Feel free to browse through the archives to find tutorials, templates and articles to help you build a better blog:

Blog Archive

© Blogger Buster 2010 Home | About | Contact | Hire Me