Here is the first method on how you can put Google adsense in the middle of your Blogspot post.
- Log in to your Blogspot dashboard
- Go to Layout and Edit Html of your template and select Expand Widget
- Find this code: <data :post.body/>
- Replace the above code (#3) with the following new code:
<div expr:id=’"aim1" + data:post.id’></div>
<div style="clear:both; margin:10px 0">
<!– Your parsed Google AdSense code here –>
</div>
<div expr:id=’"aim2" + data:post.id’>
<data :post.body/>
</div>
- Save your template. Done.
Now, everytime your write a new post, put this code <!– adsense –> in the middle of the post at location where you want the adsense to appear.
So, you have actually a choice to minimize te breaking effect of the adsense to the post flow you are presenting to your reader. It is best to put the adsense after a block of information flow is completed before the next one. In other words, avoid placing the adsense in the middle of an information block that will distract your reader attention.
Second technique to put Google adsense in the middle of post
Below are steps you can follow to put Google adsense in the middle of your post.
- In your template html, find this code: <data :post.body/>
- Replace that with the following:
<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>
- Save your template to finish.
Now, everytime your write a post, put this code <!– adsense –> in the middle of the post where you want the ad to display.