Place Adsense Ads in the Middle of Articles in 12 Simplest Steps

November 07, 2017


Last 3 day, I have changed my blog template and unfortunately, my Adsense ads don't come out in the middle of my article, where it always be in the previous template. I have tried many ways until I found this one and happy to share it here. (also for my references)

The placement of Adsense ads is the most crucial part of the process. It plays the biggest role on how excellent you will earn money from it. There are 4 places where you can usually place your ads:

1. Above the article
2. Below the article
3. On the sidebar
4. In the middle of article
However, most of the readers might only pass-by the article - not the whole page. So, if you don't place your Adsense in the middle of your article. It will indirectly inflict a financial loss.

Do you want your ads to show up like in the image?

Also, read: How I Can Gain Visitors On My Blog Post?

Here is how to place your ads in the middle of your article in the simplest way. It uses HTML but still the easiest way. No worry.

0. Precaution: Please download the previous theme.

1. Open your Blogger dashboard.

2. Choose Theme

3. Click on Edit HTML

4. Press "Ctrl + F" for quick search.

5. Find:
 <data:post.body/>

6. There will be more than one of this code. I recommend choosing the second

7. Replace it with this code:

<div expr:id='&quot;post1&quot; + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
--ENCODED ADSENSE CODE--
</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>

8. Go to Adsense dashboard

9. Create an advertisement unit, prefer responsive type.

10. Encode the ads HTML code, you may use HTML ENCODER.

11. Replace --ENCODED ADSENSE CODE-- with the encoded code.

12. Save the template.

Congrats! You have finished! You can try to view the ads in your articles now. However, some newly created ads may take several minutes to start showing on your blog.


If these steps don't work on your blog. I'm sorry, please reuploads the previous theme.

Have a nice day!

You Might Also Like

6 Comments

  1. i like ur new blog theme!
    thanks for this tutorial, and nice tips! thanks :D

    ReplyDelete
  2. hmm my google adsense got problem so i couldnt even put one. me is sad.

    ReplyDelete
    Replies
    1. What's the prob? I've been suspended for one month before this hahaha

      Delete
  3. Oh gosh. I never thought the ads can be placed in middle of the article. I will try now. :D

    ReplyDelete