Verification: 900d95e0779452a0
Follow us on Facebook
Powered by: tecpharmacy

How To Insert Adsense Inside Posts - After the First Paragraph

SHARE:

How To Insert Adsense Inside Posts -Tecpharmacy



To solve the problem, we will just move the locations of the ads to be displayed by adding JavaScript and DIVs. With the following script, you can easily choose the paragraph or heading after which you want to inject the ad to. This way, you won't have to manually change every post.


How to Display AdSense Ads after the First Paragraph in Blogger

1. Log into your Blogger account, select your blog and click "Template" on the left side. Open the Template editor using the "Edit HTML" button. Once the editor has opened, click anywhere inside the code area and press the CTRL + F keys (or Command + F) on your keyboard to open the editor' search box. Search the following line: 
<data:post.body/>
Note: You will find multiple occurrences of<data:post.body/>, stop at the second one or if you don't see any changes, test the last one.

2. Add the below DIVs in red before and after, like this:
<div id='adsense-target'><data:post.body/></div>
3. Copy the AdSense code that you want to show and use this tool to convert it into plain text. Just above the line that we just found, add the following HTML and replace the "ADSENSE CODE HERE" text with the converted ad 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>
Screenshot:


Align AdSense Left or Right

By default, the Google AdSense ad unit will appear in the middle just after the first paragraph. If you are unhappy with the results and want to wrap text around the ad, you can choose one of the options below:

a) Align AdSense to the left: change <div id='adsense-content' style="display:block;text-align: center"> with
<div id='adsense-content' style="display: inline-block;float: left;margin:15px 15px 15px 0px">
After modifying it, the ad will display something like this:

adsense inside posts, adsense placement

b) Align AdSense ad to the right of the content: change <div id='adsense-content' style="display:block;text-align: center"> with
<div id='adsense-content' style="display:inline-block;float:right;margin:15px 0px 15px 15px">
4. Finally, right after <div id='adsense-target'><data:post.body/></div> (step 2), add this script:
<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>
Note:
- To insert the ad after the second paragraph, change "0" from the line in red with "2".
- If you want to put AdSense just below the heading h2 or heading h3 of a post, replace br from &quot;br&quot; withh2 or h3

5. Click "Save template" to save the changes and you're done.

With this trick, you can insert AdSense after the first paragraph automatically in Blogger with ease. Now it's your turn to decide which format works best on your site.

COMMENTS

BLOGGER: 1
Loading...
Name

9Mobile,3,Acer,2,Admet,3,Afrione,1,Airtel,4,Alcatel,6,Allcall Bro,2,Amazon,2,Amazon Echo,1,Android App,14,Android Games/Apk,76,Android OS,8,Android Phone Specs,66,Apple,1,Archos,2,Asus,6,Autoloader,2,Blackberry,5,Blackview,18,blogging,15,Blu,10,Bluboo,2,Bontel,2,Brave Souls APK,1,Cagabi,1,Cherry Mobile,3,CMX,1,Coolpad,1,Cubot,5,Custom Rom,1,Data Bundles,14,Dll Errors,1,Doogee,6,Elephone,12,Energizer,1,Etisalat,2,Facebook,1,featured,8,Fero,2,Finow,2,Firewall,1,Flashfiles,9,Flashtools,10,FRP,4,gadgets,1,Game development,2,Games,30,Gaming Console,2,General,74,GFive,2,Gionee,33,Gionee P8W,1,Gionee S6s,2,Gionee Steel 2,1,Glo,4,Google,6,Gowin,2,GPS,1,Gretel,2,Gsm Aladdin,1,GTA For Android,1,GTA V,1,GTA V Apk+Data,1,Guest Post,5,Headphones,1,Hotwav,3,How To's,129,Hp,3,HTC,10,Huawei,21,iNew,2,Infinix,48,Infinix Note 3,2,Infinix Note 3 Pro,2,Innjoo,22,Intel Chipset,2,Intex,8,Iphone,5,Iphone 7,1,Irulu,1,Itel,24,Itel S31,1,K-Touch,1,Kata,5,Keecoo,1,Kenbo,9,Kimfly,5,Koolnee,1,Laptop Specs,8,Laptops,17,Lava,1,Leagoo,21,Lenovo,31,Lenovo P70,1,lenovo Phab 2 Pro,1,LG,7,Lumia,1,Lumia Price,1,M-Horse,23,Malata,1,MBO,6,Meizu,7,MI FlashTool,3,Micromax,1,Mobie development,1,Motorola,6,MTN,4,Neon,1,Networking,1,Nintendo,1,Nintendo Switch,1,Nokia,15,Nokia 6,1,Nokia Lumia,1,nougat 7.0,6,OBI,3,Oneplus,4,Oppo,13,Opsson,1,Oukital k6000 Pro,1,Oukitel,7,Pacfiles,3,Panasonic,3,Pes2017,1,Pes2017 Apk+Data,1,Philips,1,Phone,1,Ppsspp Games,6,Qmobile,3,QMX,2,ROMS,449,Roms/Firmware,489,Rooting,3,Samsung,71,Sapio,1,Smart Gadgets,4,Smart watch,5,Smartphone Specs,153,Smartphones,223,Smartphones Review,305,Sniper 3D Assassin,1,Softwares,49,Solo,1,Sony,16,Sp Flashtool,43,Spice Mobile,1,Spreadtrum,16,Stock Roms,32,Tablets,4,TechNew Update,10,TechNews,40,Technology,9,TechTutorials,32,Tecno,77,Tecno Camon C9 Plus,1,Tecno W5,3,Tecno W5 LTE,2,Templates,6,THL,2,Tips & Tricks,12,Twinkas,1,TWRP Recovery,4,Typing Speed,1,ulefone,15,Ultimate Cycler,1,Umi,4,UmiDigi,4,Vernee,3,Vivo,3,Vkworld,12,Vodafone,1,Vphone,1,Walton,1,Web design,1,web surfing,20,Web Tutorials,22,wiko,11,Windows 10,6,Wiselinktool,1,Wordpress,1,X-tigi V11,4,XBO,4,Xiaomi,27,Youtube,1,Zopo,10,ZTE,3,
ltr
item
Tecpharmacy: How To Insert Adsense Inside Posts - After the First Paragraph
How To Insert Adsense Inside Posts - After the First Paragraph
How To Insert Adsense Inside Posts -Tecpharmacy
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDA6z_g5bQ8X6mx9UcG0f8uM8kEmzvXyxruyhdHzxwxSZ7A-dNwgWPbtROhAjV01fAQyd8yAA2DzgP0hVRiLhgyhU4IIQkMABwIJXAbJXafPVoAmWtnWGgr8-ngyIubcuZirYRn6Wpvjxn/s1600/blogger-adsense-after-first-paragraph-left-wrap-text.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDA6z_g5bQ8X6mx9UcG0f8uM8kEmzvXyxruyhdHzxwxSZ7A-dNwgWPbtROhAjV01fAQyd8yAA2DzgP0hVRiLhgyhU4IIQkMABwIJXAbJXafPVoAmWtnWGgr8-ngyIubcuZirYRn6Wpvjxn/s72-c/blogger-adsense-after-first-paragraph-left-wrap-text.png
Tecpharmacy
https://tecpharmacy.blogspot.com/2016/08/how-to-insert-adsense-inside-posts.html
https://tecpharmacy.blogspot.com/
https://tecpharmacy.blogspot.com/
https://tecpharmacy.blogspot.com/2016/08/how-to-insert-adsense-inside-posts.html
true
5899790456862012682
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy