As a blogger, we try to provide unique and quality content. At same time, we also try to make some money from it. The first choice is AdSense, as it does pay well in all ads network.
As AdSense only allows 3 standard ad units and 3 link units in one page, one way to try to make more money is to always show maximal allowed ads.
We are writing programming related posts at lifelongprogrammer.blogspot.com.
We show 3 standard ad units: one at one at header,one inside the post body, and one at left-sidebar,
It's easy: just add 2 Adsense widget or HTML/JavaScript widget in Layout setting, and add the ad in appropriate place in the post.
But what about the homepage, archive page, label page?
What We Got
Adsense shows at most 3 standard ad units in order of the ads in the page. In blogspot, the order is like below: center blog post, left side bar(if any), right side bar(if any).
This is not we want:
1. We want to show ads "above the fold" - where user can read without scrolling.
Ads "above the fold" will have a better click-through rate than ads below the fold.
Place ads near where visitors eyeballs naturally go to in order to get the best CTR (top left, near titles, near site navigation, etc).
Read more at 5 Simple Adsense Layout Examples for Increasing Click Through Rates
2. Blank space in left side bar makes blog look ugly and unprofessional.
What We Want
For homepage, archive page, label page, we want Adsense always shows the 3 standard ad units above the folder: the ad at header, the ad in the first post, the ad in left side bar.
Also for other posts, in the ad slot, I want to display alternative da, for example chitika: anyway, Less is better than Nothing.
Also in the first post, we want to display one link ad unit below title, one link ad at the end of post.
With the following change, we see immediate change in Adsense revenue.
Solution
Edit Template
We edit the template: define one variable firstAds, it's true by default, at the end of post <data:post.body/>, change its value to false.
How To Insert Adsense Ads In Blogger Post
7 Blogger Page Types: Analysis, Code Snippets, Data Matrix
5 Simple Adsense Layout Examples for Increasing Click Through Rates
As AdSense only allows 3 standard ad units and 3 link units in one page, one way to try to make more money is to always show maximal allowed ads.
We are writing programming related posts at lifelongprogrammer.blogspot.com.
We show 3 standard ad units: one at one at header,one inside the post body, and one at left-sidebar,
It's easy: just add 2 Adsense widget or HTML/JavaScript widget in Layout setting, and add the ad in appropriate place in the post.
But what about the homepage, archive page, label page?
What We Got
Adsense shows at most 3 standard ad units in order of the ads in the page. In blogspot, the order is like below: center blog post, left side bar(if any), right side bar(if any).
<div class="columns-inner"> <div class="column-center-outer"/> <div class="column-left-outer"/> <div class="column-right-outer"/> </div>Adsense will always fill the first ad at header, for the remaining 2 ads, Adsense fill 2 ads in the first 2 posts, and leave blank area in left side bar.
This is not we want:
1. We want to show ads "above the fold" - where user can read without scrolling.
Ads "above the fold" will have a better click-through rate than ads below the fold.
Place ads near where visitors eyeballs naturally go to in order to get the best CTR (top left, near titles, near site navigation, etc).
Read more at 5 Simple Adsense Layout Examples for Increasing Click Through Rates
2. Blank space in left side bar makes blog look ugly and unprofessional.
What We Want
For homepage, archive page, label page, we want Adsense always shows the 3 standard ad units above the folder: the ad at header, the ad in the first post, the ad in left side bar.
Also for other posts, in the ad slot, I want to display alternative da, for example chitika: anyway, Less is better than Nothing.
Also in the first post, we want to display one link ad unit below title, one link ad at the end of post.
With the following change, we see immediate change in Adsense revenue.
Solution
Edit Template
We edit the template: define one variable firstAds, it's true by default, at the end of post <data:post.body/>, change its value to false.
<script src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'/> <!-- define firstAds = true --> <script>var firstAds = true;</script> </head> <div class='post-header'> <div class='post-header-line-1'/> <script> <!-- display one link ad below title if it's first post --> // <![CDATA[ if(firstAds){ document.write("<br><ins class='adsbygoogle' ></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script>"); } // ]]> </script> </div> <div class='post-body entry-content' expr:id='"post-body-" + data:post.id' itemprop='articleBody'> <data:post.body/> <!-- display one link ad after the first post, and set firstAds to false --> <script> // <![CDATA[ if(firstAds){ document.write("<br><ins class='adsbygoogle' ></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script>"); firstAds=false; // change its value to false } // ]]> </script>
Use firstAds to Conditionally Display Ad in Post
When add ad in post, we will use the firstAds variable: if it's true(means this is the first post in homepage, archive page or label page), display Adsense ad, otherwise display alternative ads.
ResourcesWhen add ad in post, we will use the firstAds variable: if it's true(means this is the first post in homepage, archive page or label page), display Adsense ad, otherwise display alternative ads.
<script> //<![CDATA[ if(firstAds){ document.write("<ins class='adsbygoogle' ...></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script>") } else { // javasctipt to show alternative ads. } //]]> </script>
How To Insert Adsense Ads In Blogger Post
7 Blogger Page Types: Analysis, Code Snippets, Data Matrix
5 Simple Adsense Layout Examples for Increasing Click Through Rates