How to Install Adsense Ads in the Middle of Article Posting - Google Adsense is an advertising service that is widely used by bloggers as well as me to get a little extra income, to increase Adsense income, ad placement also has an effect on the ads above the article as well as under the article. recommended and also does not disturb your visitors later when reading your article.

Placement of Adsense ads in the middle of posts can also increase your Adsense impression with 400 words in 1 article, friend so that the ads that are displayed are not close together and are pleasing to the eye, Google Adsense has 2 types, you know? Hosted same as Non Hosted


How to Install Adsense Ads in the Middle of Article Posts

Add Adsense Ads in Middle Blogger Articles

Procedure :

How place Adsense ads in middle of articles? 

First, friend, first go to Blogger > Themes > Edit HTML, (click CRTL + F to find fast) , look for the code 

<data: post.body /> 

then replace it with the code below.

Remember in the template there is a lot of code <data: post.body /> so my friend try one by one until the ad appears in the article.

The Adsense code that you want to install should be parsed Parse code from here first

<div expr:id='&quot;post1&quot; + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>

PASTE ADSENSE CODE HERE By fixiw 

</center>
</div>
<div expr:id='&quot;post2&quot; + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById(&quot;post1<data:post.id/>&quot;);
var obj1=document.getElementById(&quot;post2<data:post.id/>&quot;);
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf(&quot;&lt;br&gt;&quot;);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}
</script>

Below is the code for 2 adsense ads in 1 post

<div expr:id='"post1" + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>

PASTE ADSENSE CODE HERE By fixiw

</center>
</div>
<div expr:id='"post2" + data:post.id'><data:post.body/></div>
<div class='googlepublisherads' style='margin:20px 0'>
<center>

PASTE ADSENSE CODE HERE By fixiw

</center>
</div>
<div expr:id='"post3" + data:post.id' />
&lt;script type='text/javascript'&gt;
var ads1=1/5;
var ads2=4/5;
var a=document.getElementById(&quot;post1<data:post.id/>&quot;);
var b=document.getElementById(&quot;post2<data:post.id/>&quot;);
var c=document.getElementById(&quot;post3<data:post.id/>&quot;);
var html=b.innerHTML;
var n=html.length;
var t=html.substr(0,n*ads1);
var i=t.lastIndexOf(&quot;&lt;br&gt;&quot;);
var t2=html.substr(0,n*ads2);
var i2=t2.lastIndexOf(&quot;&lt;br&gt;&quot;);
if(i&gt;0 &amp;&amp; i2&gt;0){
a.innerHTML=html.substr(0,i);
b.innerHTML=html.substr(i+4,i2);
c.innerHTML=html.substr(i2+4);
}&lt;/script&gt;


The ones marked in green are replaced with your Adsense code.

  • Easy is not the way to install it? I got this code from the code structure ... good luck, and leave a comment if you face any issue with this code. 

OK, that's all I can explain about  How to Install Adsense Ads in the Middle of Posting Articles. Thank you for visiting, hopefully it will be useful for all of you.

Post a Comment

Previous Post Next Post