Show Adsense in Begining, Middle and the End of Blogger Post - Automatic



Google AdSense is the most ideal approach to procure income through your blog. For this reason arrangement of advertisements on correct spot is significant where inclusion is most extreme. In this post, we will examine propelled practices to show advertisements at the opportune spot to produce high income from your blog and offer worth to your composition ability. There are two places in a post where there is high inclusion of an advertisement unit. Inclusion of promotion unit means clear perceivability to perusers and more odds of getting clicks. A standout amongst the most significant area is simply beneath post title/beginning of the post and other is center of the post. In this article, we will likewise talk about how to put AdSense inside Blogger post as it were. Advertisements on the Blogger Static Pages won't show up.

Show AdSense Inside Blogger Post Automatically

Hereunder is a script that will indicate advertisements toward the begin and center of the post naturally. This script finds the center piece of the blog entry and consequently place a promotion. For some blog like tech web journals where HTML code sharing is normal won't work superbly it may divide shared code. Be that as it may, on every single other blog, it will work flawlessly.

This code is likewise for the individuals who are utilizing scripts to demonstrate the post extract on their landing page.


CASE-I: For those who are using post excerpt on the home page.

To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code, and hit the save button.


CASE-II: For those who are using default Blogger theme i.e. no post excerpt on the home page.
To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code,


<b:if cond='data:blog.pageType == &quot;index&quot;'>
<data:post.body/>
</b:if>
Now paste the following code just above it, and hit the save button.
<!-- Ads in mid of post: automatically -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div expr:id='"atmid" + data:post.id'/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at mid of the post -->
</div>
<div expr:id='"attop" + data:post.id'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at top of the post -->
</div>
<data:post.body/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at bottom of the post -->
</div>
</div>
</b:if>

<script type="text/javascript">
var obj0=document.getElementById("atmid<data:post.id/>");
var obj1=document.getElementById("attop<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf(" ");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+1);}
</script>
<!-- Ads in mid of post: automatically -->





If you want to display ads on certain posts, you can use post label to control ads visibility. The following script may work for you.
To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code, and save the changes.


<!-- Ads in mid of post: automatically -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div expr:id='"atmid" + data:post.id'/>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at mid of the post -->
</div>
</b:if>
</b:loop>
<div expr:id='"attop" + data:post.id'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at top of the post -->
</div>
</b:if>
</b:loop>
<data:post.body/>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at bottom of the post -->
</div>
</b:if>
</b:loop>
</div>
</b:if>

<script type="text/javascript">
var obj0=document.getElementById("atmid<data:post.id/>");
var obj1=document.getElementById("attop<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf(" ");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+1);}
</script>
<!-- Ads in mid of post: automatically -->




Notes –
1. You can use three different labels for three different ads at top, mid and bottom of the post. Must change value Label-Name with actual Label of your post.
2. Must change following three values with your three different/same ad code.
<!– Paste Ad code here: Appear at top of the post –>
<!– Paste Ad code here: Appear at mid of the post –>
<!– Paste Ad code here: Appear at bottom of the post –>

 

 Put AdSense in the Middle of Blogger Post

If you want to place an ad at the custom location in between post, then there is also a solution for you. You have to place <– ads –> tag where you want to show the ad i.e. at the custom location in between your every post.

To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code, and save the changes.


<!-- Ads in mid of post: automatically -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div expr:id='"atmid" + data:post.id'/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at mid of the post -->
</div>
<div expr:id='"attop" + data:post.id'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at top of the post -->
</div>
<data:post.body/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at bottom of the post -->
</div>
</div>
</b:if>

<script type="text/javascript">
var obj0=document.getElementById("atmid<data:post.id/>");
var obj1=document.getElementById("attop<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/x3C!-- ads --x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+13);}
</script>
<!-- Ads in mid of post: automatically -->
 
 
Same as I explained above if you want to display ads on certain posts, you can use post label to control ads visibility. The following script may work for you.

If you want to place an ad at the custom location in between post, then there is also a solution for you. You have to place <– ads –> tag where you want to show the AdSense inside Blogger post.

To use this script go to Theme HTML and search for <data:post.body/> and replace this code with the following code, and save the changes.


<!-- Ads in mid of post: automatically -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div expr:id='"atmid" + data:post.id'/>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at mid of the post -->
</div>
</b:if>
</b:loop>
<div expr:id='"attop" + data:post.id'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at top of the post -->
</div>
</b:if>
</b:loop>
<data:post.body/>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name == &quot;Label-Name&quot;'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at bottom of the post -->
</div>
</b:if>
</b:loop>
</div>
</b:if>

<script type="text/javascript">
var obj0=document.getElementById("atmid<data:post.id/>");
var obj1=document.getElementById("attop<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/x3C!-- ads --x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+13);}
</script>
<!-- Ads in mid of post: automatically -->


Notes –
1. You can use three different labels for three different ads at top, mid and bottom of the post. Must change value Label-Name with actual Label of your post.

2. Must change following three values with your three different/same ad code.

<!– Paste Ad code here: Appear at top of the post –>

<!– Paste Ad code here: Appear at mid of the post –>

<!– Paste Ad code here: Appear at bottom of the post –>

3. Add <– ads –> tag tag in each post in HTML mode.


Important: Before adding/injecting AdSense or some other ad codes in a Blogger theme, you have to Parse it otherwise it will not appear in the posts. To parse AdSense code you can use our AdSense code parser code.


1 Comments