How to put Google adsense (ads) code block in the middle of blogger blogspot blog post
71Can you put Google adsense in the middle of your post?
The answer is yes. You can display Google adsense in the middle of your Blogger Blogspot post. The way to do this is a bit more compilcated than displaying the adsense in other parts of post mentioned in other hub. That is probably why not so many bloggers have implemented this technique for their blogs, compared to the other techniques. However, if you are looking around, you can see few bloggers have used this technique to display Google adsense.
The only thing to bear in mind is that, Google adsense in the middle of post will break the flow of your post information. Your readers may not so like this and therefore may affect your presence online. However, it is all you to decide whether to display Google adsense in the middle of your post or prefer other more common techniques such under post title or in the beginning of post.
Steps to display Google adsense in the middle of post
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.
Other Google placements
- Best google adsense placements for blogspot blogs
This is a very important question to answer to get the best results of your Google adsense. As a income generating tools, where you put your Google adsense in your blogs will have a significant affect to the...
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.








tripzibit 13 months ago
Hi, i already tried but always got error message
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute "{1}" associated with an element type "expr:id".
Please help me how to fix it