NOTICE

Adfly Links not working Find Direct Links HERE

How to show adsense ads any where in Blogger posts

I think you have seen many tutorials on placement of Adsense ad codes in between blogger posts.But their placement was limited to the starting or at the end of the post.But what if we want to add Adsense ads any where we want in between the post ? Here is simple effective and safe Hack.By using which you can past or make your Adsense Ads visible in any part or your post like in middle of your post :)



Installation :

Step 1 :

Login your BLOGGER account And click on Layout in the sub menu click then Edit HTML now Check Expand Widget Templates


Now Find <data:post.body/> And Replace it With Below code





<div expr:id='"aim1" + data:post.id'></div>

<div style="clear:both; margin:10px 0">

<!-- Your 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>






Now Replace <!-- Your AdSense code here --> in above with your Adsense or any other Ad code

Now Save Your Template !


Problem: Some times it does not saves your template and gives Error. Then Parse your Adsense Code on This Site then paste it in Above Code.


Step 2 : Now where you want your Adsense code in the post Just Add this Code

<!-- adsense -->

This code will show Adsense Ad ! :)

1 comment :

  1. Hi.
    I exactly did what you said.. But still Adsense ad is not showing in my post..Do I need to parse my Adsense ad code.. Please help

    ReplyDelete

Feel free to leave comment if you like above widget, have any questions or just say Hi! :)