Put Adsense Code in Center of Article

You maybe interested with this article Put Adsense Code in Center of Article. If you are blogger and want to publish your article in the potential area, you would be very interested to see your ad appear in the center of article. This is intended to increase click on the ads that you display.

So, go directly to the step;

1. Parse your adsense code or any ads code to HTML to XML parse page. This is to convert HTML code to XML code because you want to put adsense code at posting layout.

2. Go to blogger >> template >> Edit HTML




3. Search <data:post.body/> by Ctrl+F. You will found more than 1 of the code, please choose the second.

4. Please replace the <data:post.body/> with this code

<div expr:id='&quot;post1&quot; + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
--Put ad code that you have parse--
</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>

Note : You can change number 2 to change your ad position/paragraph.

I hope you can understand this tutorial how to Put Adsense Code in Center of Article.

Post a Comment

0 Comments