How To Automatically Insert Adsense Ads Inside Post In Blogger Posts.

Adsense is the most popular and trusted way to earn money through blogging. You can put ads almost anywhere in your blog but the most profitable area is the post, because that is the area where most of your readers and visitors are interested in. almost 88% of the search, referral, social and direct traffic comes there.




So placing an ad inside post will probably generate more income than any other place. But unfortunately you can't place ads inside post, blogger doesn't have this feature in the settings, so we came up with a tweak which will allow you to put your desired ad code or adsense code below 1st., 2nd and later paragraphs. without wasting any time lets start the tutorial.  

Automatically Insert Adsense Ads Inside Post In Blogger Blogs

This is and advance method and requires some coding knowledge, You have to be familiar the working process of blogger's HTML editor to follow this method. if you follow this method you can add css to your blog very easily.

Before Editing we recommend you to make a backup of your template, so that anything goes wrong you still have your blog design safe.

The First thing you need to do is to login into your Blogger account and go to >> Templates >> Edit HTML and search for the ending <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.

After you get the code just replace it with below code.


<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='adsense-content' style="display:block;text-align:
center">ADSENSE 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>
  1. ADSENSE CODE HERE Replace this text with your adsense code, but before replacing you have to convert the code with special tool, convert your adsense code by going to this Adsense Ads Converter.
  2. adscont,linebreak[0] To insert the ad after the second paragraph, change "0" from the line in red with "2".
Now save your template by clicking the Save button.
Newer Posts Newer Posts Older Posts Older Posts

Related Posts

Comments

Post a Comment

Loading