How to Place Ad sense or any Ads in Middle of the Post in Blogger - 100% Work


Placing Adsense ads in the middle of all the posts will give a high CTR which eventually increases earnings. In word press, There is a customized plug-in available for placing ads in the middle of the posts. But in case of a blogger, it is the somewhat tricky part to place Adsense ads in the middle of all the posts. We have developed a script which can place AdSense ads in between the post exactly in the middle of the content. The procedure for placing Adsense ads in the middle of the posts in blogger is shared below.

Place Ad sense Ads Automatically In Middle of All the Posts in Blogger:

Follow the below process to place Adsense ads in Middle of all the posts automatically in blogger.

Step 1:

Login to Your Blogger Account
Go to Template >Edit HTML

Step 2:

Search for below Code in your template.

<data:post.body/>

You will get multiple codes similar to the above code. You have to select the second code which is similar to the above code in order to make the script work properly.

Step 3:


 Once you have selected the AdSense code, you need to parse it so that it is XML recognizable which is required in this task. To do this, you can use this tool.

Step 4:

Replace the above Code With the Below Code.
<div id='jobmiddlenew'> 
<data:post.body/> </div> 
<b:if cond='data:blog.pageType == &quot;item&quot;'> 
<style> #addcodemiddle{display: none;} </style> 
<div id='addcodemiddle'> Place Your Ad Code Here </div> 
<script type='text/javascript'> var str1=document.getElementById(&quot;jobmiddlenew&quot;).innerHTML; var str2=str1.length; var str3=str2/2; var substr = str1.substring(str3, str2); var n = substr.search(&quot;&lt;br&gt;&quot;); if(n&lt;0) { n = substr.indexOf('.'); if(n&lt;0) { n=0; } var firsthalf = str1.substring(0, str3+n+1); var secondhalf = str1.substring(str3+n+1, str2); } else { var firsthalf = str1.substring(0, str3+n+4); var secondhalf = str1.substring(str3+n+4, str2); } var addcode=&quot;<center>&quot;+document.getElementById(&quot;addcodemiddle&quot;).innerHTML+&quot;</center><br/>&quot;; var newbody=firsthalf+addcode+secondhalf; var strnew=document.getElementsByClassName(&quot;post-body entry-content&quot;); strnew[0].innerHTML=newbody; document.getElementById(&quot;addcodemiddle&quot;).innerHTML=&quot;&quot;; </script> 
</b:if>

Step 5

Replace The Place Your Ad Code Text with Your Ad sense or any Ad Code in the above code and save your template.

Step 6

 Whenever you would write a post or to add the advertisements in the middle of an already existing post, you would need to follow these easy steps every time.


1. Locate the place in a post where you want to add the ad in the HTML post editor mode.


2. At the located place, enter this snippet for the ad to appear.
<!-- AdSense -->
3. Once the post is done, click Save or Publish or Update.

If you are facing any kind of issue then do let us know in your comments. Happy Blogging 

Post a Comment

Previous Post Next Post