≡ Menu

Place adsense in middle of your blogger post

Many analysis are saying that Adsence blocks placed in middle of blogger post performing well and earning good amounts to the bloggers. To fill my pockets as well, I tried placing the adsense block after reading one blog post entry and in vain, I tried several other also…still failed. I have read many posts from other bloggers about placing Adsence advertisement in middle of post but none of them worked straight forward — I think they are stale. After some struggle, I could able to sort-out the process.

So, follow the below steps if you want to see adsense blocks in middle of your post.

  • Prepare your adsense code — Get adsense code from your adsense account and convert it usingadsense-blogger blog-ad-converter to make it compatible with CSS.
  • Logon to blogger and select the layout option and from there “edit HTML” option.
  • Very important step here is to backup your template. Don’t miss to do this as it saves your time in case if you want to revert (who knows, my procedure also might fail for you)
  • Select the check box “Expand widget template” and search for the tag <data:post.body/>” and replace with below code.

<div expr:id='”aim1″ + data:post.id’></div>
<div style=”clear:both; margin:10px 0″>

<!– Remove this line and place your Your converted AdSense code here –>

</div>
<div expr:id='”aim2″ + data:post.id’>
<data:post.body/>
</div>
<script type=”text/javascript”>
var obj0=document.getElementById(“aim1<data:post.id/>”);
var obj1=document.getElementById(“aim2<data:post.id/>”);

var s=obj1.innerHTML;
var r=s.search(/x3C!– adsense –x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>

  • Save your template and check your blog. It should display the ads now.

Enjoy and Happy blogging…

[Source]