One of the known tips for improving the performance of your Google AdSense ads is knowing where to place the ads. In this guide, we shall discuss the modification you can make to your Blog template to have your Google AdSense ads appear between your post title and post body, or between your post body and post footer. Also, we shall have the AdSense ads appear on every individual post.
Choosing a best placement for your AdSense ads will attract more attention; attention leads to clicks; and clicks bring you AdSense revenue. Easier said. While people may have theories on where the ideal AdSense spot ought to be, there is really no standard answer because it depends very much on your Blog's layout, contents, theme, etc. If you have been following the changes made to our Blog, you would agree that we are no guru at this. We had merely placed the ads where they fit aesthetically and not where they will get the most attention. Nevertheless, if you would accept our two cents' worth of opinion, try to put yourself in the minds of your readers. Ask questions like why readers visit your Blog, which section of the Blog are they most interested in, and whether placing an ad at a particular area will distract, annoy or please them.
Many people believe that having AdSense ads just before or after the Blog posts will best optimize their performance. For the purposes of this article and to give you an idea how it would look, we have inserted the AdSense code into our template to have the ads appear immediately below the article and before the post footer. If you think you would like to do the same for your Blog, the following are the steps you should take.
Update: A section on Using Blogger Feature to insert the AdSense Ads after every post.
Using Blogger Feature
If you merely want an Ad to appear after every post or every few posts, use this Google feature instead. Go to Template -> Page Elements and you see in your layout the heading “Blog Posts”. Click the “Edit” link at the bottom right corner. You will see this screen.
We assume you have a Google AdSense account. If you don't, you can create one using the same login through your Google account. You will be assigned a Publisher identity number which shall appear in all your AdSense codes.
Tick the “Show Ads Between Posts.” You can select whether to show ads after every post or after several posts. In accordance with AdSense TOC, a maximum of 3 Ads will be displayed. Choose the ad format and color scheme. Save the changes and refresh your Blog to see the Ads.
While using this Blogger feature is simple and easy, you may want more control over the position of the Ads. For example, you may want it between the title and posts rather than after the posts. The following guide will show you how you can do that.
More Ad locations
Log in to your Google AdSense account.
Go to AdSense Setup -> Products and choose “AdSense for Content”.
Next, select “Ad unit” and follow their instructions on picking the size of ad, color combination, and so on, right till the end when they automatically generate a HTML code for you. Copy this code and paste it into Microsoft Notepad. (If you are a WinXP user, click the Start button at the bottom left corner of your screen. Under All Programs -> Accessories, you should see the MS Notepad icon.)
Change the AdSense code
This heading may sound misleading. We are not at all altering the code but converting some of the characters to character entities. We have to parse the AdSense code so that it can be included into your Blog template. This is not against AdSense rules because after the code is inserted into the template, when you view the source code of the template, you should see the exact same AdSense code that Google has generated for you. Indeed, if it is anything different, it means that you have not parsed it correctly and should review the code again. Parsing the code essentially involves replacing the following HTML characters:-
< with <
> with >
" with "
Your final Google AdSense Code should look something like this:-
<script type="text/javascript"><!-- google_ad_client = "pub-0000000000000000"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as&amp;quot;; google_ad_type = "text"; google_ad_channel = ""; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "000000"; google_color_text = "000000"; google_color_url = "000000"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> |
|---|
Insert code into template
Login to your Dashboard. Go to Template -> Edit HTML and click the box next to “Expand Widget Templates”.

Block copy the entire HTML code for your site that you presently have and save it in a separate text file in MS Notepad. You can also click the "Download Template" link to backup the template. This is one of the two necessary steps whenever you want to change the template. The second step is to “Preview” the new changes, and save the changes only when you are satisfied. The backup you have saved in a text file will come in handy when you accidentally click to save the changes without previewing them. With a backup, you can easily restore the template to the prior state if need be.
Now search for post.body through your browser's search function (Ctrl+F for Firefox and IE). You should see these lines:-
<div class='post-body'> <p><data:post.body/></p> <div style='clear: both;'/> <!-- clear for photos floats --> </div> |
|---|
If you want the AdSense ads to appear between the post title and post body, add the following code above the orange lines. If you want the AdSense ads to appear immediately after every individual post, add the following code below the orange lines. The code to add is:-
<div style='float:left;'> AdSense Code </div> |
|---|
The AdSense Code is the one you have amended above in MS Notepad. Do NOT save the template, but click the Preview button to see if you like the placement of the AdSense ads.
Do you want to have the AdSense code on the left of your text as shown in this screenshot?

Choose the smallest AdSense format like 125x125. Insert the AdSense code here:-
<div class='post-header-line-1'/> <div style='float:left;'> AdSense Code </div> <div class='post-body'> <p><data:post.body/></p> <div style='clear: both;'/> <!-- clear for photos floats --> </div> |
|---|
If you want the Ads on the right of the text, like this:-

Insert the code as follows:-
<div class='post-header-line-1'/> <div style='float:right;'> AdSense Code </div> <div class='post-body'> <p><data:post.body/></p> <div style='clear: both;'/> <!-- clear for photos floats --> </div> |
|---|
Set the AdSense ad margins
If your AdSense ads are too close to the edge, you may set a margin in the style tag. To give you an idea how wide the margin should be, you can see the sample in our other Business Fables blog where the left margin is set to 30px. The code used was:-
<div style='float:left; margin-left:30px'> AdSense Code </div> |
|---|
Should you want to align the AdSense ad to your text, you can specify a margin or padding around the entire AdSense code. The code you can use is:-
<div style='float:left; margin:5px 10px 15px 20px'> AdSense Code </div> |
|---|
The first number 5px is for the top margin, 10px is for the right margin, 15px for the bottom margin, and 20px for the left margin. You should of course change these values to suit your template.
Preview the template and if you are satisfied, save the template and refresh your Blog to see the new positions of your AdSense ads.
Other than Google Ads, you can learn how to place AdSense Product Referrals in your Blog.
Additional money-making opportunity
Since we are on this topic of earning revenues through AdSense, you may want to consider earning money while you are surfing the net. AGLOCO seems to have an interesting scheme which you may want to take a look. If you are surfing the net anyway as part of your daily routine, why not earn the extra income as well. You may also want to consider having AuctionAds to display an eBay auction widget which is compatible with AdSense and other ad systems.
© Tips for New Bloggers




76 comments:
Hi! Thanks for the article. I did find an easier way to convert the adsense html code to xml. there's a handy parser available at http://blogcrowds.com/resources/parse_html.php
I have used it and implemented the code in my blog, saves you time from manually changing all the code.
Thanks a million for sharing the "know how's" on the placement of Adsense. I followed the steps in your article and now my ads are blending in with my posts. The question I would like to ask is that, why am I getting two ads at the same time into my first and second post? How do I place only one ad in between my posts? My idea is to have one ad at the top, one ad in the middle and another ad right at the bottom.
Hi Nihal
By placing this code into the template, you will have automatically have an ad weaved into each post. But because Google allows only 3 ad units per page, you will see the ads at the very top, as well as in the first 2 posts.
If this is not what you want, you can Add a Page element -> AdSense at the top and at the bottom. You can't have one in between because as mentioned, placing this code into your template means you will have an ad in each post and not after selective posts.
You'll make me crazy.. After 15hours of blogging tonight i prove to write a tutorial in english language: I'd like to write ( and to link) seems your post but... but HOW YOU CAN DO TO WRITE THE CODE : if you write < change in.. <, the Pc transform automatically & lt in <... My mind is likes a Vulcano! Now i must stop, tomorrow is another day (R. O'Hara)..!!!!
Hi BlogmasterPg
If you have problems writing the code in your tutorial, you can either:-
1. Write your post in "Edit HTML" mode rather than "Compose" mode; or
2. Put your code within "textarea" tags. If you look at the article "Hyperlinks and Image Links (II)", I gave an example near the bottom on how you can insert codes into a "textarea".
Hope it helps.
doesn't it against google adsense TOS my friend?
Hi arent city
Answer is no. And if you are aware of any rule in particular, do let us know.
Changing the character entities in order for the code to be inserted into a template is a computer language thing. If you view "source" of your page in a browser, you will find the exact same AdSense code that Google provides.
Thank's bizwhiz...
I was able to follow most of your tutorials on the fly.
I am trying to make the ads to show ONLY in either Mainpage or Itempage. For E.G., I have implemented your code to show ads in between Post Title and Body. But these ads are showing up in the Mainpage also. What I would like to know is, How I can make these ads to show ONLY in PostPage?
You help is most appreciated
Hi Lux
You want the ad to show only in your Post and not in your main or index page?
I doubt you can do that because Blogger doesn't give us control over the template of each individual page.
Hi bizwhiz,
I came across some blogspot blogs where I could see Ads that appear either ONLY in Mainpage Or Itempage. This is one site labnol.blogspot.com.
If I am going to have Adsense Ads in between Post Title and Post Body, then I would end up in having 10 Ads in the Mainpage.
Hello,
I have tried multiple methods of adding Adsense ads either below the post header or underneath the body of the post, but both result in the text of the post disappearing and only the google ads remaining. Any idea why this is happening? I am using the Minima layout, so it's not a custom one per-se.
Hello Fayna
If your text disappears, it is probably because the code data:post.body has been accidentally replaced or deleted.
Just to be sure, the entire code (in orange) is not to be deleted. The AdSense code should appear either above or below the entire code (in orange). Would you like to try it again?
Thanks a ton, able to do that to my blog http://truemoviefan.blogspot.com
Was searching for this from quite some time, finally you made my day... :)
hi... I tried using your code for adding the adsense code after each post. But i get the error message saying ' 404. object not found'.
What should i do?
my blog is http://videochronicles.blogspot.com
Hi Neonirvana
After adding the code, when you click to Preview the template, if the code is not well-formed, there will be a message informing you so. If it is well-formed, you should be able to preview your template. Did you see the adsense ads when you preview the template?
This error message that you said - when did it show? after you have saved the template and refreshed the page?
I done as you said, and AdSense is below every my post but my other AdSense disappear now?! What to do now?
BTW your blog is absolutely GREAT!
Hi TDR
How many ads do you have in total? Could it be that you have more than the maximum number allowed by Google? i.e. - three ad units, three link units per page?
Nice. I have it one my site now!! Thank you so much.
Nice. I have it one my site now!! Thank you so much.
www.buzzbee.org
As I have no g-mail account and also my blog URL not friendly with blogger, I comment as an anonymous. I first of all thank you for this valuable informative blog. Your blog is very very useful to the beginner like me. It inspire me to switch over to blogger.com from my present blog http://www.blogchex.com/health4inspiration.
At present most of the sites are being banned for adsense account for the reason best known to google. Hence, I have decoded to place fair ads network ads in my future blog in blogger. So, I request you sir,kindly guide me where to paste the FAN codes in new blogger as you have shared here adsense.
I hope for your early post. hanks a lot.
Hi Anonymous
Since Fair Ads is a contextual ad network, it is in direct conflict with Google AdSense terms. At the moment, we have no plans to try it out and will not be writing any guide on it.
However, on your question as to where to place the code, if there is a HTML/JavaScript code supplied to you, the way to put it into the template is the same as how you would insert other codes.
Under Template -> Page Element -> Add a Page Element, select HTML/JavaScript and paste the code under your posts, above your posts, or at the sidebar.
Perhaps you can surf the net for guides from people who have used this service in their Blogger blogs.
Thanks sir for valuable inputs. As you explained as an expert but I unable to pick it up as a beginner. I request you kindly explain as you explain in your post such as you mention 'paste adsense code here' like this. I will be ever greatful to you if you do some extra labor for me sir.
I surf a lot but could not find any guides from people who have used fair ads service in their Blogger blogs.
Regards.
Hi Anonymous
This article is about putting an AdSense code between the Header and Post, or directly underneath the Post. We have inserted the code right into the template, after testing it out and knowing that it works.
If your whatever ads has a code that is similar to AdSense, you can try doing the same. Replace the
<
>
"
Then insert it into the template as if it were an AdSense code. We do not know if it will work since we have no intention to switch to other Ads service.
If you are a beginner as you claim, you may want to insert the code using "Add a Page element" as I mentioned in the earlier comment. You can try that.
This is as much as we can say on your query. We are not experts and have never pretended to be. What we learned, we put in writing. Maybe we might try out FairAds in future, and if we do, we shall write an article on that. Until we do that, it is not right for us to comment on it or to give advise that we have no way to test and verify.
Thanks sir, I hope your valuable input will definitely work. I again thankful for spending your valuable time for me. Whoever accept or not, I, as a beginner, accept you as an expert and so please do not take it otherwise. For your information, I have learned a lot about bloggers blog from your posts and very soon I am going to launch my own blog at blogger.com with your valuable inputs. I finally hope for your involvement in fair ads and expect an nice post (tutorial) in this connection.
Best regard.
Hi, I've added the code for adsense, and it looks great except for the next line "posted by" the "P" is on the same line as the Adsense text. Any idea how to change that? My site is: http://happyscrapgirl.blogspot.com/
Hi Happy Scrap Girl
You are having a text link ad. If you want it to be before the "posted by" line, you can add after the adsense code:-
div style='clear: both;'
Remember to start with a < and end with a />
Thank you so much! It's formatted properly now. Thanks for your help, and thanks for sharing this wonderful blog info with us!
Thanks very much for the post. I am looking for how to do it a long time.
It works perfectly.
Hi,
I followed your instructions. It works perfectly when I view only a single post. But, when i view more than one posts (from labels or from blog archive or even when I am in my home page) - It does not show the ad below the first post. Please note that I have other two Adunits - one on left side bar and the other on top of all posts.
My question is - when i view more than one posts, then the adsense code should be displayed at least for the first post, right? But it does not. Also, then why is the adsense code displayed when i view only a single post?
Pls help me out.
Thanks a lot for your wonderful blog.
Hi robertfrost
Since you did not indicate your blog address, we are unable to take a look. However, we did the same thing with our blog. If you click any of the labels to display several posts in the page, you will see only 2 posts with Ads because we already have an Ad unit in our sidebar. Google allows 3 Ad units.
It should be the same in your case. You may want to try looking at your site again, or have your friends look at it from other ISP addresses to see if there is a difference.
Thanks bizwhiz for your quick response. I think i could not make you understand my point.
Here is my blog address:
http://EnterBangla.BlogSpot.com
If you visit it, you will see only two google ad units - one at the left side bar and the other - just after the blog title & description. Now, if you click on the title of any post, you will see the embedded adsense ad coming up (between the post header and post body). But, this one ad should have been displayed at all instances - right?
Please note that the template that I use is not provided by blogger.com. I found this template in some other site (beautiful beta).
Thanks in advance for your help.
Hi robertfrost
Did you add the code before the line - div class='post-body'? For that matter, is there such a line in your template? Could you look at the code again?
I can think of no other reason why the third Ad does not appear. If I can find a solution, I'll let you know.
Thanks bizwhiz! You gave the right solution!
I had put the adsense code before post.body instead of post-body, that's why it was not working properly. But now after correcting - it is working :-)
Another thing, instead of replacing '<','>' and '"' with new tags, I replaced only the '<' and '>' tags in my adsense code (which means I did not replace the '"'s). Can it cause any problem or Adsense TOS violation?
Hi robertfrost
The "" should be changed as well. If the code is not well parsed, it may not work or there may be an error message when you try to save the template.
If the code is parsed as per the guide, when you view the source code of your blog, you will see the exact same code that Google provides. There is no change and therefore is in accordance with their TOS.
Thanks for being so useful!! Actually I had used many of your tricks.
Thanks again.
Hello, there:
What if I want to add adsense ad at the bottom of each post just before "post by..."?
Thank you
Fanny
Hi Little Robin Hood
In the article, there is this part which reads "If you want the AdSense ads to appear immediately after every individual post, add the following code below the orange lines." The AdSense ads will appear after the post and before the "Posted by" line.
Oh, yes, I am so blind. Thank you.
Fanny
Hi. I am Author from HarianDAILY. I want ask some question regarding Adsense Code inside post body ? For your information I already banned from Adsense program. So I want to put "Bidvertider Program" to replce the Adsense Code. I try to put already but cannot work. Can you solve my problem Bro.. Thanks & Nice to meet you.. My blog is In Malay & English (http://hariandaily.blogspot.com/
Hi Author
We have not tried using "Bidvertider Program" and have no idea what their code looks like.
What we can say is that if they have provided you a JavaScript, you can insert the code by going to Template -> Page Elements -> Add a Page Element. If that can work, and if you want to insert that code into your template so that the ads will appear after the post, you will have to parse the < > and " characters.
If you still have no success, please search the net for guidance by people who have used this service you have mentioned. Alternatively, you may write to the service provider and they should be able to assist you.
Hi, Bizwhiz:
I have added the code before (div class='post-body')and after (div class='post-header-line-1') The ads appears fine for the first page, however, the following pages do not show any ads.
Could do take a look?
http://truth-sg.blogspot.com
Thanks
Fanny
Hi Fanny
The other pages show the ads too. But since Google allows only three ad units on a page, the remaining ads will not be shown if you have several articles on one page. This includes the ad units in the sidebar, header or footer.
If you see a blank space sometimes, it could also be that Google could not match a relevant ad to the keyword.
Hi, Bizwhiz:
did you see ads in the post body in other pages too except the first page? I couldn't, I can see ad wrapped into the post body only on the first page. the following pages all the ad in the post body are not showing. I placed one ad unit on the side bar and only allow to show two posts at one page. Thanks for quick reply.
Fanny
Wow at last I found a very informative post about adsense embedded placement...realy works!!!great!!!
thaaaaaaaaaaaaaaaaaaaaaanx alotz
nice blog
congratulations
MY blog is :
Agloco
and can we back link each other
thank you....
does nt cgange of code block adsense account
Hi ellithy
I believe we had discussed that at length in the article and comments. Parsing the characters is to enable insertion into the template which uses a certain coding language. When you view the page source of your Blog after saving the page, you will see that you have exactly the same code that Adsense provides. In fact, if you don't, it means you have not parsed the code correctly.
Hi ,
I have followed the instruction for adding the adsense to my post very carefully but after i have edited my xml template and i either preview or save the template i get an error page returned
Not Found
Error 404javascript:void(0)
Publish Your Comment
Can anyone help?
Hi Healthfreak
The error 404 is likely to be a Blogger server related problem. Try editing the template again at another time. If the code is well formed, you should be able to preview it.
Hey! thanks for this tutorial. Been finding means and ways to work on how to get the Ads to appear on my content. thanks for the tutorial
Farik
http://surfanywhere.blogspot.com
hi bizwhiz, is there anywhere to put ad code, only appear at the newest latest post, instead of every post?
Hi Lemonjude
Maybe, but we haven't explored that yet. Even with the Blogger feature, the Ad will automatically appear after a selected number of posts and not after the recent or a specified post only. If we come across a way to do that, without infringing AdSense TOS, we'll write about it.
How to fix error NOT WELL-FORM when insert Adsense code into template ?
Hi Anhvo
That could happen when the code is inserted at the wrong place. The alternative would be to use the Blogger feature - Edit Blog Post to insert the Ad after every post.
Hi and compliments for this great blog.
I want to ask you this: I want to put the Adsense code into the middle of a single specific post (so not after the title or else..), so I ask you how to make this.
Maybe.. if I go into the specific post's html and insert there the code? Is it possible to do this?
And if not possible, is this a limit of the blogspot architecture?
Thaks so much
Hi JsJs
The short answer is that it can't be done. You are not able to have a customized template for each individual post page.
Hi bizwhiz, and thankyou for the reply.
I have found an article with a procedure to do this, so please can you look it for a moment?
Here is the link: adsinthemiddle.blogspot (dot com).
But when I try to find the tag <$BlogItemBody$> on my template (as in that guide) I don't found it.
Is that procedure possible? Is a fake? Or it works only for an older version of blogspot or blogger?
What do you think about it? Is that adaptable for our blogspot current version? And how?
Thankyou.
What is your blog url, JsJs?
Hi JsJs
Your blog is also using a new Blogger template. The procedures you have outlined will not apply since those are for old classic Blogger templates.
how can i add (older post) link dynamically?
Hi dai
You can take a look at the article on Status Message and Older Post.
hey, thanks for your help..
you have my cl*k..
hehe... thanks alot...
Thanks as alwasy for your tips, but i am a bit confused about the colour blend of in text ads. You have any suggestions for that?
Hi ICLfan
You can look at this article on choosing of colors for Ads -
http://adsense.blogspot.com/2006/01/color-your-ads-beautiful.html
and the AdSense site's explanation of custom colors and blending colors.
hi, looking for a parsed widgetbucks code so i could place it between posttitle and postbody, thanks
Hi coronet
We believe "widgetbucks" is based on contextual advertising which AdSense prohibits. We shall therefore not be subscribing to or commenting on that.
hi bizwhiz,
As I know google only allow 3 adsense in every single page. However, there will be more than that since we inserted the adsense code in post(if the blog show 4 posts in 1 page)
are we against the google policies?
What I do is show 1 post in each page. However, if people click to show all post in 1 page, will I break the rules?
urgent need to know, thanks alot
Hi MZ
AdSense will automatically show ads in the first 3 posts and none in the remainder.
Thanks for the info. Very useful and simply said. Cheers,
Andy
www.financeviewpoint.com
I appreciate this article but I also have a question about 3 or more ads appearing.
On other pages in my blog I have 3 or more ad units displayed because of this trick and the rest of the others simply don't show up because of google's policy.
What I want to know is am I still complying will google's tos because only 3 ad units show up and the rest just appear broken?
I have more than 3 ad units on the page because I have ads inbetween the title and body of my posts, but the ads come up broken, as they should.
Am I safe?
Hi Amplifiers
As far as I know, even if you have inserted more than 3 ad units, only the first 3 will be automatically displayed in the Blogger blog and that is in line with their policy. If you have further concerns, you could raise them with the AdSense team and let them get back to you on their official stand.
Thanks. I appreciate that
I have something to say ...