Automatically Display Any Affiliate Ads in the Middle of Blog Post?

How to add any affiliate ads including AdSense ads in the middle of Blogger Blog post automatically? This widget will measure the post page height automatically and start display ads In the Middle Of Blog Post. You can display any ads or widget in the middle of Blog posts.

Comments: 16
data:blog.title
Automatically Display Any Affiliate Ads in the Middle of Blog Post?

In WordPress platform we often see advertisement can be display in different places. Generally it can be done by the help of Plugins. And Plugins helps to circulate the ad place and display in different place. This is one of the most effective way to increase Ads revenue. And this strategy works best to increase ad revenue. 

In Blogger platform hasn't any opportunity to use plugins mobilize ad placement trick. But we can use JavaScript to display ads at the middle of the Blog post that can increase our ad revenue. Most of the returning Blog readers become ad blind, because they know where ads has placed in your site and they avoid that place. But by using this widget you can display ads in the middle of the Blog posts and readers will click on ads naturally.

Previously I have shared a widget where we can display AdSense ads anywhere inside of a Blogpost. But that widget you have to use manually, because while you make post you have to place manual code <!-- adsense --> like this, where you want to display ads. Many users may not like this widget because of manual works. So to get ride from that you can use this automatic affiliate ad display widget. Even now you can display any widget in the middle of Blog Post. This widget has several features, those are as follows:
  • Display ads at the middle of the Blog Post.
  • You don't have to manually put code.
  • This will automatically search the place to display ads.
  • You can display multiple ad units.
  • Any widget like related post widget can be display at the middle of the Blog posts.
  • You can easily  remove the widget.
Sounds great! I hope you are pretty excited to integrate this widget in your Blogger site. So let's proceed to the tutorial. Please take a backup of your Blogger template before proceed. After that go through the below steps-by-steps walk through.


Step #1: Log in to your Blogger Account and go to Dashboard

Step #2: From vertical options click on Template ->Edit HTML->

Step #3: Instantly locate <data:post.body/>  by Pressing  Ctrl+F (Windows) or CMD+F (Mac) 


You will find this code  <data:post.body/>  3/4 times, Please go for second one.

Step #4: Once you find it then replace <data:post.body/> code by below script.

<div expr:id='&quot;adbox&quot;+ data:post.id'/>
<div style='clear:both;text-align:center;margin:15px 0 15px 0'>
<!-- Place Your Ad Code here -->
</div>
<div expr:id='&quot;adsbox&quot;+ data:post.id'><p><data:post.body/></p></div>
<script type='text/javascript'>
var obj0=document.getElementById(&quot;adbox<data:post.id/>&quot;);var obj1=document.getElementById(&quot;adsbox<data:post.id/>&quot;);var s=obj1.innerHTML;var t=s.substr(0,s.length/2);var r=t.lastIndexOf(&quot;&lt;br&gt;&quot;);if(r&gt;0){obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>
           
Step #5: Please replace line with your affiliate ads, AdSense or widget code. And click "Save template” from the HTML editor.

Note that for placing AdSense ads you must parse the script first. Simple use are Parser to use AdSense code in the widget.

You can check your Blog post now and see ads has started display in the middle of the Blog Post automatically.

A Simple Solution

If your Blog already have many posts then you may see some problem. Some broken script will appear at the bottom of the ad banner. To fix this issue simply make a gap between ad banner and texts in Blog post editor. After that see the preview, if you see broken script is not appearing then simply publish or Update the post.

Automatically Display Any Affiliate Ads in the Middle of Blog Post?

If you have any query regarding this widget then simply feel free to write a comment below. I will try to get connect with you soon. Thank you.

Speak Your Mind

i want to show 3 ads inside my post,How to do it?

Hi Ansary Pangader,
I didn't test the 3 ads but you can replace the below text from above code by 3 AdSense ad script. I think it will work.

<!-- Place Your Ad Code here -->


Please let me know. :t

thank you for this... works perfectly

Hi Joseph O :)
Thanks for your feedback.:up

Thanks man, it works! thumbs up to you

Welcome phonetweakers.. :up

Anonymous 8/18/2017

Sorry if I sound like a beginner...
I don't understand replace line with your affiliate ads

Hi There
In the above code block you will see a line like below

<!-- Place Your Ad Code here -->

just you have to replace this line by your affiliate ad script. Every affiliate ad network will provide their script to display their own advertisement. So you have to generate ad script and replace this <!-- Place Your Ad Code here --> line by your affiliate script.

Thank you :up

please i cant find this code in my template

Hi there,
You have to find below code. And you will find it 2/3 times in your blogger theme.

<data:post.body/>

Thank you ^_^

thanks
am done with it now
but i wanted to display 2 ads unit inside my post
is it possible?
my web urel is htt://ipostcity.com

Hi iPostcity,
Just add 2 ad script. and it will start display 2 ad banner. :)

PLACE_YOUR_PARSE_ADSENSE_CODE_HERE

use this above and below

it will cover the total post from start to end

In this case you can use non-responsive ad banner.

728px X 90px

How To Place Adsense Ads In Middle Of The Post In Blogger
https://goo.gl/vzB4mK

Please read the article you will understand. Thank you :)

Facebook Group Community Code ConverterHide Code Converter Show EmoticonHide Emoticon

If you Got questions? Ask ’em below! While we’re here, you might like to leave a comment and let me know if you have any stories or questions.

Make sure you tick the Notify Me box below the comment form to be notified of follow up comments and replies. Thank you for commenting

Contact Form

Name

Email *

Message *