Friday, August 20, 2021

How to add adsense ads in between bloggers blog post

Hi friends earning from adsense is a great source for bloggers ,but for maximizing earnings and taking full advantage of adsense you need to place the adsense ads at right spots in your website to increase your ctr and cpm which will give you maximum revenues. 

you can place your ads at top leaderboards , in upper fold side box of 300x 250 to get maximum benefits but its is ad-viced that you must place atleast 1 ad  inside a post to increase ctr sand revenues .

now the question arises how to display an AdSense ad in the middle of a post or anywhere inside the post ?

For placing the ad inside the post We need to manipulate template , then  we need to place a label inside our post to where we want the AdSense ad to appear. Once added, we can place the ads anywhere, be it between paragraphs or in the middle of the content etc,the ads will appear where we place the labels.

so come on without a do lets tweak your template to place adsense ads in your post to maximize your earnings via adsense


Note: Before proceeding, it is recommended do backup your template (go to Template > click on theBackup/restore button)

Step 1. First thing you need to do is convert your adsense ad code to plain text. for which use the site given below.
just paste your ad code in it and you will get parsed ad code to use anywhere in your xml based blog post

http://www.eblogtemplates.com/blogger-ad-code-converter/

It will work with all ad network code like AdSense, AdBrite, Chitika etc to convert java based code in to simple code only for u:):)

Step 3. Then go to Template, click on the Edit HTML button, click anywhere inside the code area and look for this tag (CTRL + F):

<data:post.body/>

Note: you may find it several times, but we need to stop at the second one or if you can't see any changes, test the third one


How to add adsense ads in between bloggers blog post


Step 3. Replace the <data:post.body/> tag with this code:

<div expr:id='"adsmiddle1" + data:post.id'></div>
<div style="clear:both; margin:10px 0">
<!-- Add here the code of your ad -->
</div>
<div expr:id='"adsmiddle2" + data:post.id'>
<data:post.body/>
</div>
<script type="text/javascript">
var obj0=document.getElementById("adsmiddle1<data:post.id/>");
var obj1=document.getElementById("adsmiddle2<data:post.id/>");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>

Step 4. Put the converted Adsense code to where you see the <!-- Add here the code of your ad -->annotation, then save the changes by clicking on the Save template button

Step 5. When you create a New Post, add the tag given below inside the HTML section in the exact location where you want the Google AdSense ads to appear.

Ad tag
<!-- adsense -->


For example:
<div>This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.</div>
<!-- adsense --><div>This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.</div>

Note: If you don't add the label in the post  to show ad  at desired place then the ad appears below the title by default.

if you want to put adsense ads in middle of the post automatically then paste the code given below in place of 2nd one of this code<data:post.body/>(you need to replace it with the code given below )


<div id='jobmiddlenew'>
 <data:post.body/>
          </div>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<style>
#addcodemiddle{display: none;}
</style>
<div id='addcodemiddle'>
Place Your Ad Code Here//replace this with your converted adsense ad code
    </div>
 <script type='text/javascript'>
var str1=document.getElementById(&quot;jobmiddlenew&quot;).innerHTML;
var str2=str1.length;
var str3=str2/2;
var substr = str1.substring(str3, str2);
var n = substr.search(&quot;&lt;br&gt;&quot;);
if(n&lt;0)
{
n = substr.indexOf('.');
if(n&lt;0)
{
n=0;
}
var firsthalf = str1.substring(0, str3+n+1);
var secondhalf = str1.substring(str3+n+1, str2);
}
else
{
var firsthalf = str1.substring(0, str3+n+4);
var secondhalf = str1.substring(str3+n+4, str2);
}
var addcode=&quot;<center>&quot;+document.getElementById(&quot;addcodemiddle&quot;).innerHTML+&quot;</center><br/>&quot;;
var newbody=firsthalf+addcode+secondhalf;
var strnew=document.getElementsByClassName(&quot;post-body entry-content&quot;);
strnew[0].innerHTML=newbody;
document.getElementById(&quot;addcodemiddle&quot;).innerHTML=&quot;&quot;;
</script>
  </b:if>

now if you want to place ads below title ,in middle and at bottom of blogspot/bloggers blog automatically in each post then replace the 2nd appearance of <data:post.body/> with the code given below.

<div id='jobmiddlenew'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
place converted ad code here
</b:if> <data:post.body/> </div> <b:if cond='data:blog.pageType == &quot;item&quot;'> <style> #addcodemiddle{display: none;} </style> <div id='addcodemiddle'> place converted ad code here </div> <script type='text/javascript'> var str1=document.getElementById(&quot;jobmiddlenew&quot;).innerHTML; var str2=str1.length; var str3=str2/2; var substr = str1.substring(str3, str2); var n = substr.search(&quot;&lt;br&gt;&quot;); if(n&lt;0) { n = substr.indexOf(&#39;.&#39;); if(n&lt;0) { n=0; } var firsthalf = str1.substring(0, str3+n+1); var secondhalf = str1.substring(str3+n+1, str2); } else { var firsthalf = str1.substring(0, str3+n+4); var secondhalf = str1.substring(str3+n+4, str2); } var addcode=&quot;<center>&quot;+document.getElementById(&quot;addcodemiddle&quot;).innerHTML+&quot;</center><br/>&quot;; var newbody=firsthalf+addcode+secondhalf; var strnew=document.getElementsByClassName(&quot;post-body entry-content&quot;); strnew[0].innerHTML=newbody; document.getElementById(&quot;addcodemiddle&quot;).innerHTML=&quot;&quot;; </script> </b:if> <b:if cond='data:blog.pageType == &quot;item&quot;'> converted ad code//you can place more than 1 ad also like 1 link ad and 1 picture ad etc as per your liking </b:if>


This method doesn't violate Google's Terms of Service because you are not changing the structure of the ad.

1 comment:

Shaun Michael said...

I like your post this is very interesting information about How to add adsense ads in between bloggers blog post . Because this is a very unique fact Being a student who values this kind of information, I am grateful that I came to your website today looking for case study helper. This essay really caught my attention. If you're a student and ever need homework help, I recommend that you go to this website.

Post a Comment

A2 Hosting Takeoff With Turbo Sale