• Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / Free Blogger tutorials blogspot platform beginners to advanced / How to add adsense to blogger anywhere

How to add adsense to blogger anywhere

how to add Adsense code  in below post title Middle, after 1st paragraph in blogger Sidebar and the mobile template too.

Table of Contents

Toggle
  • 1  AdSense code in below post title in blogger
      • 2. Insert Adsense Ad middle of the blogger post.
  • 3. Add Adsense ad After 1st /2nd  paragraph In blogger
    • 5. how to add Adsense ad below Below post content in blogger
    • How enable Ads in Blogger Mobile Template?
      • Is parsing Adsense code legal / illegal / against google AdSense policies?
    • how to add Adsense code to  without parsing?

1  AdSense code in below post title in blogger

  1. Find  <data:post.body/> in your template
  2. Paste Adsense above it without parsing see below
  3. There are 3 <data:post.body/> tags generally 2nd works. if you enable search description then automatically other one works.
  4. if you confused just reply I will back with you within minutes.

The normal themes above             2nd  <data:post.body/>
works OK.

its working     find this <div class=’post-body entry-content’ expr:id=’&quot;post-body-&quot; + data:post.id’ itemprop=’description articleBody’>
below it
or
<data:post.body/> 2nd above it

TIP  if you confused to find  correct <data:post.body/> among 3. you can put a symbol before the <data:post.body/> like 1 for 1st line, 2 for 2nd one, 3 for 3rd one. save template. visit your website and check which number appearing in below post title in blogger. simply replace that with your adsense code.

paste the ad code below  also you want right or left central use  div id float left
<div id=”leftFloat“>A left-floated div</div> <div id=”rightFloat“>  for center simply put this codes <center> adsense code </center> or simply you want place left use this <div align=’left’>
<div style=’float:left;’>

<script type=’text/javascript’> //<![CDATA[ Adsense code without parsing //]]>

2. Insert Adsense Ad middle of the blogger post.

NOTE: If you enable Custom Search Blog description Then <data.post body/> turns to next adsense ads not appears for this again you have to test which data post body tags works for you generally without custom description 2nd one works for custom search description 3rd works in blogger. this credit was goes to imranuddin who was made it request of someone one may be me.

Step: 1Find  <data:post.body/> 2nd or 3rd and replace with this.

Step 2:<div id=’jobmiddlenew’>
  
 <data:post.body/>

          </div>

<b:if cond=’data:blog.pageType == &quot;item&quot;’>

<style>
#addcodemiddle{display: none;}
</style>
<div id=’addcodemiddle’>

<script type=’text/javascript’> //<![CDATA[ Place Your Ad Code Here without parsing //]]>


    </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>

3. Add Adsense ad After 1st /2nd  paragraph In blogger

Step I,Find <data:post.body/>

STEP 2: Replace with

<b:if cond=’data:blog.pageType == &quot;item&quot;’>
<div id=’adsense-content’ style=”display:block;text-align: center”><script type=’text/javascript’> //<![CDATA[ Place Your Ad Code Here without parsing //]]></div></b:if><div id=’adsense-target’><data:post.body/></div><script type=’text/javascript’>
function insertAfter(addition,target) {
var parent = target.parentNode;
if (parent.lastChild == target) {
parent.appendChild(addition);
} else {
parent.insertBefore(addition,target.nextSibling);
}
}
var adscont = document.getElementById(&quot;adsense-content&quot;);
var target = document.getElementById(&quot;adsense-target&quot;);
var linebreak = target.getElementsByTagName(&quot;br&quot;);
if (linebreak.length &gt; 0){
insertAfter(adscont,linebreak[0]);
}
</script>

Step 3 Customization Center/ left /right

<div id=’adsense-content’ style=”display:block;text-align: center”>
a. do you want right then replace code with
<div id=’adsense-content’ style=”display:inline-block;float:right;margin:15px 0px 15px 15px”>
b.If you want left side then just
replace right with left in above code.
4. IF You want to place ads both  in Middle and After 1st paragraph 
then Add Middle Ad 1st Follow the process above.
to Add After 1st paragraph
just replace <data:post.body/>. That works fine.

5. how to add Adsense ad below Below post content in blogger

The easy way to you can add it by Editing blog Posts widget in blogger layout and check Display Adsense ads between the Number of posts, you can select responsive add also from there.

f you want to add a text unit that’s not possible, All you have to do just place ad code after <data:post.body/>(ad code goes here) align it t center.

6.Sticky Adsense Ad to blogger Sidebar /footer /header?
This illegal set by google Adsense team, I have used this also for 4-6 Months also lots of publishers using in WordPress but not achieved expected results.

How enable Ads in Blogger Mobile Template?

If you are using Responsive theme That’s ok, but if you are using classic blogger template, and redirected to the  mobile template.
Then you may notice No Ads by checking it desktop too. just adding this URL parameter and at the end of website URL ?m=1.
FOR enabling mobile Ads on Default blogger mobile template. you have to add at least 1 AdSense from blogger gadgets, you can below post or sidebar.
check earnings option in the sidebar option and click on  show ads on this blog enable. lAlso you can check your AdSense account eligibility from there.
Responsive link units available for responsive templates.
Check our News Blogger responsive templates updates,
look at Social Share Widgets for blogger,

Is parsing Adsense code legal / illegal / against google AdSense policies?

Maybe, illegal if your time bad. Modifying adsense code against in adsense policies that leads to display more than 3 ads per page. waste of time thinking about that.

what happens if you parsed the Adsense code?

Adsense not automatically blocks if more than 3 ad units on the website page.

how to add Adsense code to  without parsing?

<script type=’text/javascript’>
//<![CDATA[
… Adsense code …
//]]>
</script>

 

Ask a Question:

You must be logged in to post a comment.

Free Blogger tutorials blogspot platform beginners to advanced

  • blogger to wordpress migration in 3 simple steps
  • How to create/add xml html sitemap for blogger
  • Blogger Templates Responsive updated
  • Connecting Domain to Website Blogger / Wordpress etc
  • How to add adsense to blogger anywhere
  • Customize Blogger Template
  • Embed rss feed / label / frame sitemap in blogger post page
  • Blogspot blogger seo Basic Optimization tips
  • how to disable right click copy and paste on blogger

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy