Breaking News

How To Add Adsense Ads In The Middle Or Anywhere Inside Blogger Posts

How To Add Adsense Ads In The Middle Or Anywhere Inside Blogger Posts



In a past post, we perceived how and where we can put Adsense advertisements on our blog; nonetheless, these strategies would possibly work when we place the promotions on foreordained and fixed areas. For posts zone, the most widely recognized spots are underneath the title, toward the start of the post or toward the part of the arrangement. 

In any case, imagine a scenario in which we need to show an AdSense advertisement in a post. 

We can control the area of the advertisements to be shown by including a content inside the layout and utilizing a tag inside our post to where we need the AdSense promotion to show up. Once included, we can put the promotions anyplace, be it between passages or in the substance and so on. 

Related: Insert AdSense inside posts after the principal passage 

Physically embeddings AdSense advertisements in posts in Blogger is really simple, simply pursue these means underneath: 

Including Adsense Ads In the Middle or Anywhere inside Blogger Posts 

Prior to continuing, it is prescribed to reinforcement your layout: go to "Format" and snap on the "Reinforcement/reestablish" catch to spare a duplicate on your hard drive. 

Including the content

Step 1. First thing we need to do is to parse the AdSense code and convert it to plain text. Then go to "Template", click on the "Edit HTML" button and click anywhere inside the code area to search using CTRL + F keys for this tag:
<data:post.body/>
Note: you may think that its multiple times, yet we have to stop at the subsequent one. Or then again, in the event that you can't perceive any changes, test the third one.


Step 2. Replace <data:post.body/> with this code:
<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>
Step 3. Add the converted Adsense code on where you see the <!-- Add here the code of your ad --> annotation, then save the changes by clicking on the "Save template" button.


Note: For centering the ads, add the <center></center> tags before and after the AdSense code, like this:
<div style="clear:both; margin:10px 0">
<center>
<!-- Add here the code of your ad -->
</center>
</div>

Adding the AdSense annotation to display the ad

Step 4. When you create a New Post, add this annotation inside the "HTML" section to where you want the Google AdSense ads to appear:
<!-- adsense -->
For example:
This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.<br /><br /> <!-- adsense -->This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.




If it's not too much trouble note that on the off chance that you don't add this explanation to indicate where to show the advertisement, at that point it will show up beneath the title of course. 

So this is the way we can include AdSense promotions in the center or anyplace inside our Blogger posts. Try not to stress over abusing the Google's Terms of Service in light of the fact that applying this technique won't adjust the advertisement' structure.

No comments