Monday , January 23 2017
Home / blogger / Add Adsense Code Inside The Post Blogger

Add Adsense Code Inside The Post Blogger

You can get more views on your adsense ad by Add Adsense Code Inside The Post. But putting your adsense ads unit code in all posts takes so much time but we can Add Adsense Code Inside The all posts  in blogger  by using javascript follow below tutorial to show adsense ads between all posts in blogger.

 

Add Adsense Code Inside The Post

Go to blogger.com and login your account.
Now go to your blog dashboard by clicking on your blog title.
From dashboard click on template.

Add Adsense Code Inside The Post

Add Adsense Code Inside The Post

In next page you will see your current template preview an 2 buttons one is customize and second is EDIT HTML.

Click on edit html button.

add-adsense-code-inside-the-post-1

Now you will see your  template code click any where on your template code and press ctrl+F to find.
<data:post.body/>

You will see  5 or 6  <data:post.body/> in your template code.

But you have to search <data:post.body/> which is near
<div class=’post-body entry-content’ expr:id=’&quot;post-body-&quot; + data:post.id’ itemprop=’articleBody’>

find and replace it with following code.

<b:if cond=’data:blog.pageType == &quot;item&quot;’>
<div id=’adsense-content’ style=’display:block;text-align: center’>YOUR ADS CODE HERE</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>

Note: Replace YOUR ADS CODE HERE with your adsense code

How to customize Add Adsense Code Inside The Post?

The above code will show your ads after first paragraph to show your ads  after second paragraph just replace 0 with 1 the 0  color  is  red in above code you can also replace 0 with 2 3 or 4 if you want to show your ads after 3 paragraphs then replace 0 with 2.

If you  face any problem ask me in Add Adsense Code Inside The Post comments i will help you.

Check Also

Increase Adsense cpc

How To Increase Adsense cpc nd earn 10$ per Day

Cpc (cost per click) very low cpc will give very low $ pr click many …

Leave a Reply

Your email address will not be published. Required fields are marked *