HOT!Join Our Community For Exclusive Blogging IdeasClick Here

Automatically Insert Adsense Ads Inside Post In Blogger Blogs

Automatically Insert Adsense Ads Inside Post In Blogger Blogs

Today we will learn Automatically Insert Adsense Ads Inside Post In Blogger Blogs. 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.

How to add css in blogger or blogspot blogs

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 tool- 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.

Conclusion

Congrats !! You have made it. now you have learned that Automatically Insert Adsense Ads Inside Post In Blogger Blogs. Visit your blog and check the awesome customization live in action, hope you liked this tutorial, if you enjoyed then please share it with your friends, we are working hard to develop more such awesome widgets please stay tuned with Us. kveðja !! (Goodbye in Icelandic!! hahaha).
A special thanks to Helplogger for the above code.
Automatically Insert Adsense Ads Inside Post In Blogger Blogs Automatically Insert Adsense Ads Inside Post In Blogger Blogs Reviewed by Templates Yard on August 13, 2017 Rating: 5

16 comments:

  1. bhout he acchi jankari sir pls visit my blog www.subtechguide.com

    ReplyDelete
  2. Example for liberty template.
    Dont have .

    ReplyDelete
    Replies
    1. Will you be more specific about the issue.

      Delete
  3. i put it in my blog https://indiancookingmaster.blogspot.in/ but showing up. what could do?

    ReplyDelete
    Replies
    1. We can't see the codes in your page source, make suye you have placed the codes in right place.

      Delete
  4. i put the code in my site www.thinktwice.tk for approval but i dont think i pasted it in the right place.. pls. help..

    ReplyDelete
    Replies
    1. We can't see the codes in your page source, make sure you have placed the codes in right place.

      Delete
  5. thank you sora, ads have managed to show, but what if add more than one advertisement in article

    ReplyDelete
  6. tanks man.i falow your example.i dont have error ,and....
    how do I check if it works?

    ReplyDelete
  7. I have tried it and it only worked on the third tag, but since i have added it already, can i add another one? the previous one i added was in linebreak 4, how can i add another one in linebreak 7?

    ReplyDelete
    Replies
    1. Currently it only supports one ad at a time.

      Delete

Powered by Blogger.