If you want to insert AdSense advertising in the middle of your post on Blogger do this:
1. Find in your template (you must check Expand Widget Templates in Blogger console) the tag <data:post.body/> and replace it with this snippet of 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>
2. Replace highlighted line with your AdSense code.
For more information read these articles:
http://adsinthemiddle.blogspot.com
http://tips-for-new-bloggers.blogspot.com/2007/05/adsense-code-in-blogger-post-body.html
No comments:
Post a Comment