How to Display Adsense Ads After First Paragraph - Blogger



How to put Adsense ads after first paragraph in your blog? if you are searching and want to know how to insert Adsense ads below first paragraph then you can know the complete process here. The below is the complete tutorial about how you can display ads below first paragraph on the blogspot. After insert the HTML code you can set the ads to display below first paragraph and it will automatically added to all pages of the blog.

How to Display Adsense Ads Inside Blogger Post After First Paragraph - Blogspot

How to Display Adsense Ads Inside Blogger Post After First Paragraph

Log in to your Blogger account then select the blog and go to "Theme" and then click on "Edit HTML" now the HTML editor will open. To show Adsense ads below first paragraph you need to edit the blogger HTML and add some extra script in it, to edit blogger HTML please follow the below steps carefully.

Note: Please Download a backup of your theme before editing HTML.

Step 1.
Login to your blogger and go to EDIT HTML and now press CTRL+F and search <data:post.body/>


Note: You will find <data:post.body/> multiple times but you need to use the second one of if you do not see any changes, test the last one.

Step 2.
Replace <data:post.body/> with <div id='adsense-target'><data:post.body/></div>


Step 3.
Now put the below code just above the <div id='adsense-target'><data:post.body/></div>


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


Step 4.
Now replace "ADSENSE CODE HERE" with your converted Adsense code.


Step 5.
Now put the below script just after <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>


Google Adsense Ads Display After First Paragraph - Blogger

Your final code will look like below

------------------------------------------------------------------------------------
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='adsense-content' style="display:block;text-align: center">
&lt;script async src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;
&lt;!-- FCT Resposnsive Link Ads --&gt;
&lt;ins class=&quot;adsbygoogle&quot;
     style=&quot;display:block&quot;
     data-ad-client=&quot;ca-pub-****************&quot;
     data-ad-slot=&quot;3789519244&quot;
     data-ad-format=&quot;link&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;</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>

---------------------------------------------------------------- 

Step 6.
Now save the theme and check it by opening any page of the blog, it will work fine for us and hope it will help you find the best solution for putting Adsense ads below first paragraph on your blog.

If you have any query related to this topic please do not hesitate to ask through comments. Please go to the comments section below and post a comment for Us and we are Happy to Help You. You can also ask about various Mobile problems by posting a comment.


0 comments:

Post a Comment

Please Share Your Thoughts