Install Google Adsense ads in the middle of the article in Blogger

Peace, mercy, and blessings of God be upon you.

We share with you a new topic that should be shared a long time ago about how to install ads in the middle of the article in Blogger automatically without installing them in each topic. This method may be suitable to increase your profits in Google Adsense, or any advertisement from advertising companies such as Hassoub can be installed others...

How to automatically include an ad in the middle of an article in Blogger

  • 1. Create responsive ad code in your Google Adsense account dashboard and then convert the code you generated from here 
  • 2. Go to Appearance --> click on Edit HTML and then search for <data:post.body/>

You will find more than one. The last one is meant. Replace the <data:post.body/> symbol with the following code

<div expr:id='"post1" +'/>

<div style='margin:20px 0'>


put here the ad code after converting it



<div expr:id='"post2" +'><data:post.body/></div>

<script type='text/javascript'>

var obj0=document.getElementById("post1<>");

var obj1=document.getElementById("post2<>");

var s=obj1.innerHTML;

var t=s.substr(0, s.length/2 );

var r=t.lastIndexOf("<br>");

if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}


put here your converted ad code...   Replace it with your converted ad code and then click save appearance

to control ad position Control by number in code s.length/2 For example to upload an ad you need to increase the number s.length/4 s. length/3 and so on...

In this way, ads will appear in the middle of the article automatically in all blog topics on Blogger

Post a Comment

To Top