How to Add Adsense ads inside the post

  • For show adsense ad or any other ads in blogger blog post follow below steps. 
Before change in Template get a backup of your template.
 
First add <!-- adsense --> comment code in your post by HTML section where you want to show this ads our script automatic will replace <!-- adsense --> with your Adsense ad script or with other script you want to use.
  • Now we need to add some code in blogger template.
For change in template Go to Template> HTML editor
Press CTR+F and Find <data:post.body/> you will find this several time in template replace second number of <data:post.body/> with below given code if it not working by replacing second number this so undo this and try with 3rd and again it not working again undo this and try this with 4th number <data:post.body/> why we try this with all <data:post.body/> because all blogger templates source code structure is different.
Copy Below code and use

<div expr:id='"adsmiddle1" + data:post.id'></div>
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style="clear:both; margin:10px 0">

<!-- Add here the code of your ad -->

</div>
</b:if>
</b:if>
<div expr:id='"adsmiddle2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("adsmiddle1<data:post.id/>");
var obj1=document.getElementById("adsmiddle2<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>


Note Replace <!-- Add here the code of your ad --> with you adsense ads code in html encode format use below tool for convert code in encode form.
HTML Encoder Converter
Now when you create new a post add <!-- adsense --> tag inside the HTML section add anywhere in post where you want to show Google Adsense Ads middle of post below of post or where you want see below example screenshot. 

 


How to Add Adsense ads inside the post How to Add Adsense ads inside the post Reviewed by Unknown on 10:42 Rating: 5

No comments: