The answer to your long asked question has finally reached home. The question still remains 'how can I be able to add Google Adsense between lines or paragraphs in my blog post?' Luckily enough, you finally found the right answer to such question because any moment from now, I will show you how I was able to add Google Adsense inside my blog posts.
Adding
of Adsense after the first paragraph of your blog posts has proven to
be one of the most profitable areas as it results to more clicks on your
Ads and more money for sure in your bank account. The difficult side is
that you can not do this by making use of the default Google Blogger
platform but the easiest part is that you can make use of codes such as
JavaScript and DIVS. Stay with me as I show you how to do just that in
few steps and seconds.
>> First and foremost, you should have a Google Adsense account, if you don't then you should get one here.
>> Log on to www.google.com/adsense.
>> Click on 'My ads' tab and the '+New ad unit' button.
>> Give your ad unit a name and select size '336 x 280 Large Rectangle' or any size of your choice.
>> Select the style and type of ad, when you are done, click the 'Save and get code' button.
>> Click inside the 'Ad Code' box, hold down 'Ctrl + A' to select all and 'Ctrl + C' to copy.
Your next step would be to parse the ad code here(convert it to plain text).
>> Paste the code that you copied in the box and click 'Parse'.
>> Copy the parse code and save it somewhere in your computer (Note pad or Word document).
The Next step is to logon to your blogger dashboard, click on 'Template' and 'Edit HTML' after you have backup your template.
>> Click inside the HTML editor and hold down 'Ctrl + F' for a tiny search box to appear at the top right corner.
>> Copy and paste <data:post.body/>
in it and click 'Enter' key on your keyboard twice. Usually there are
three instances of <data:post.body/> on your blog template, by
hitting the 'Enter' key twice, you intend making use of the second
instance. In case the second instance does not work, you can make use of
the third instance by hitting 'Enter' key thrice.
>>Add the following DIVs code before and after <data:post.body/> as indicated with red below.
<div id='adsense-target'><data:post.body/></div>
>> Copy and paste the following code a line above (<div id='adsense-target'><data:post.body/></div>) and replace 'PARSE ADSENSE CODE HERE' with the already parsed adsense code.
<b:if cond='data:blog.pageType == "item"'>
<div id='adsense-content' style="display:block;text-align: center">PARSE ADSENSE CODE HERE</div></b:if>
<div id='adsense-content' style="display:block;text-align: center">PARSE ADSENSE CODE HERE</div></b:if>
To align adsense to the left;
>> Change <div id='adsense-content' style="display:block;text-align: center"> to <div id='adsense-content' style="display: inline-block;float: left;margin:15px 15px 15px 0px">
To align adsense to the right;
>>
Change <div id='adsense-content' style="display:block;text-align:
center"> to <div id='adsense-content'
style="display:inline-block;float:right;margin:15px 0px 15px 15px">
Finally,
to be able to place ads in any paragraph of your choice or immediately
below any heading, copy and paste the following script code below this
line; <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("adsense-content");
var target = document.getElementById("adsense-target");
var linebreak = target.getElementsByTagName("br");
if (linebreak.length > 0){
insertAfter(adscont,linebreak[0]);
}
</script>
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("adsense-content");
var target = document.getElementById("adsense-target");
var linebreak = target.getElementsByTagName("br");
if (linebreak.length > 0){
insertAfter(adscont,linebreak[0]);
}
</script>
To
insert ad after the first paragraph, simply change '0' from the line in
red to '1' or '2' if you want it to appear on the second paragraph.
Also you can make it appear below any heading of your choice such as
heading 'h2', 'h3' or 'h4' by replacing 'br' in "br" with h2, h3 or h4 depending on the one you chose.
>> Click on 'Save Template' button to save changes.
>> View your blog to see changes.
No comments:
Post a Comment