Tuesday, 11 April 2017

Place AdSense Ads anywhere inside your Post in Blogger

For those of you who blog under WordPress, you would have noticed that its straight forward to add you Ads anywhere in your post just with the help of any plugin, But we are not here to discuss WordPress, instead of blogger.
Adding your Ad code below the post title on blogger can be easy compared to how to add the code anywhere inside your post content on blogger.
I believe google at this should already have a plugin which enables the publishers to display the Ads anywhere in post content, rather than edit the HTML of the entire blog just to place an ad.
As you know that ads placed inside the post content tend to have a higher CTR than any other ad on your entire blog.



HOW TO PLACE ADS INSIDE POST
1. Login you Adsense Account

2. Locate My Ads > Ads Unit > New Ad

3.  Then chose the kind of Ads you want to use, I recommend LinkAd

4. Get the code, then copy it into this HTML converter, And copy the new code you generated

5. Then, Login Blogger

6. Locate Template > Then Edit HTML

7. You will need to use CTRL+F to find this code
<data:post.body/>
NB; You will notice that there are more than two codes with that header, so we will either try the second or the third, depending on which works for you. But I recommend you try the second and third, use try and error method.

8. Then copy the code below and replace the one above
<div id='adsense-target'><data:post.body/></div>

9. Then paste this code directly Above the code <div id='adsense-target'><data:post.body/></div>
  we just replaced

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='adsense-content' style="display:block;text-align: center">ADSENSE CODE</div></b:if>
Replace ADSENSE CODE with the code you converted above.

10. Then just right After <div id='adsense-target'><data:post.body/></div>
Place the following line of code
<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>

Replace 0 wth the number of break lines you want before your ads shows, I use 4 because I use a lot o br.

11. Save your template and visit your blog.


Drop your issues lets know how to help you and also drop your testimonies.Don't forget to share with your fellow blogger on social media.


No comments:

Post a Comment