HOW TO: Insert 2 AdSense ads anywhere in Blogger posts

Let's go straight to the point. In this tutorial, we are going to teach you how to insert 2 AdSense ads anywhere in Blogger posts.

Our purpose is to improve the visibility of ads and increase the Click Through Rate (CTR).


1. Log into your Google AdSense account and create two ad units to be inserted in your posts.

2. Parse the raw AdSense codes using the HTML escape tool/parser.

3. Access your Blogger dashboard, go to Template and then Edit HTML.

4. Hit ctrl + F or F3 and find the second <data:post.body/>.

5. Copy the following code and replace <data:post.body/>.
<div expr:id='&quot;adsmiddle1&quot; +'/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style='clear:both;margin:15px 0 -10px'>
<div align='center'>

<div expr:id='&quot;post1&quot; +'/>
<div style='margin:15px 0 -10px'>
<div expr:id='&quot;post2&quot; +'>
<div expr:id='&quot;adsmiddle2&quot; +'>

<script type='text/javascript'>
var obj0=document.getElementById(&quot;adsmiddle1<>&quot;);
var obj1=document.getElementById(&quot;adsmiddle2<>&quot;);
var s=obj1.innerHTML;
var\x3C!-- adsense --\x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}

<script type='text/javascript'>
var obj0=document.getElementById(&quot;post1<>&quot;);
var obj1=document.getElementById(&quot;post2<>&quot;);
var s=obj1.innerHTML;
var t=s.substr(0,s.length/24);
var\x3C!-- adsense2 --\x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+17);}
6. Now replace ADSENSE CODE 1 with your first AdSense code and ADSENSE CODE 2 with your second AdSense code.

7. Click SAVE.


1. Go to your dashboard Settings and then click 'Posts, comments and sharing'.

9. Copy and paste the HTML comments <!-- adsense --> and <!-- adsense2 --> in the Post Template box and save settings. These two comments will be automatically added in the editor once you start a new post.

10. Lastly, open any of your Blogger posts and insert <!-- adsense --> and <!-- adsense2 --> anywhere you want. We recommend putting <!-- adsense --> after the 2nd paragraph and <!-- adsense2 --> after the 4th paragraph to make the ads more visible. If you have a short post, place <!-- adsense2 --> after the last paragraph so that the post won't look cluttered.

That's it. Just edit your previous posts and insert the two comments so that the ads will appear in your desired spot.

Was this tutorial helpful? Share this and put your thoughts into words by posting a comment below.