All templates have a special slot/widget available for placing Adsense ad code, you can also hide the widget if you don't want to use it.
- We assume you have created a new ad unit on Google Adsense.
- On Blogger dashboard, click Layout, you will find several widgets with different colors
- Edit one of these widgets, click the
icon and a new pop-up menu will appear:
- Fill in your ad unit code in the Content section,
- or click toggle button on 'Show this widget' to hide the widget.
- Click Save and wait a while for the ad to appear
Troubleshooting Post Middle Ads Not Showing
There are several conditions for the ad in middle of post to appear, namely:
- Ads only appear on paragraphs 10 and 20,
- the number of paragraphs is calculated based on
<p>
tag
Widgets for middle ads are tagged with IDs HTML01 and HTML02, script for the first middle ads:
<!--[ Script to move widget to the middle of article ]--> <script>/*<![CDATA[*/ function insertAfter(tbh,tgt) { ... var midAd01 = document.getElementById('HTML01'); var showAd01 = tgt.getElementsByTagName('p'); if (showAd01.length > 0) {insertAfter(midAd01,showAd01[10]);}; /*]]>*/</script>
Script for the second middle ad:
<!--[ Script to move widget to the middle of article ]--> <script>/*<![CDATA[*/ function insertAfter(tbh,tgt) { ... var midAd02 = document.getElementById('HTML02'); var showAd02 = tgt.getElementsByTagName('p'); if (showAd02.length > 0) {insertAfter(midAd02,showAd02[20]);}; /*]]>*/</script>
- The numbers
10
and20
are marked in two codes above to display ads in 10th and 20th paragraphs of post, you can adjust it to the number of paragraphs in your post. - The marked
'p'
is a tag that is needed to display ads, if your post still uses<div>
or<br>
tags then middle ad will not appear, replace letter 'p' in the code above according to tag you use for paragraphs .