How (and why) to display AdSense between post comments in Wordpress
November 20, 2008 in Monetizing Blogs, WordPress by Valentin
As some of you might know, I’m running a niche blog on makeup with videos and the like with a friend of mine.
Due to her excellent content (and some advice from me), the numbers are quite astonishing so far: Nearly 750 unique visitors and about 10.000 page views in the first week and over 330 comments!
At the time being, we’re focusing on building a solid user base far more than on actually monetizing the whole thing. There is a couple of good reasons for that:
- We don’t want to scare away our visitors and/or give them the overall impression that the whole thing is just there to make money.
- Our target audience is not exactly tech–savvy. Affiliate Links (especially in the listings of the products used for the makeup presented in the related video) are a far more subtle way of generating income than blatant ads.
- In the long run, we want to generate most of our revenue by doing product reviews paid for by the manufacturer or online shops, not by extensive advertising.
Nevertheless, there is some AdSense being displayed on the Site, just for the sake of it. The income has been rather disappointing so far, with about 8$ in the first two weeks and a CTR of hardly 0.25 percent. Because of that, I’ve figured that some improvement in the ad’s placement might change that (the old one is sitting in the sidebar, not exactly being overly noticeable).
What we still do not want is to make the ads strike users too much. The often advocated (and—no doubt about that—successful) technique of placing ads close to or even inside the main content is an absolute no–go for us.
The solution I’ll be trying for the next couple of weeks is going to be pretty straightforward and at the same time largely inobstrusive to users: Placing AdSense “link blocks” in between user comments.
There are some restrictions to this:
- Google’s guidelines limit the number of link blocks on a single page to three.
- Once again, I don’t want users to be annoyed by the ads.
To make a long story short: I’ve decided to display one link block after the first comment and—where applicable—after every five more comments. The maximum number of link blocks is restricted to three.
The PHP I’ve hacked together to handle that task goes into comments.php looks somewhat like this:
<?php if ( $comments ) : ?>
<?php $zaehler=0; $zaehler_ges=0; ?>
<div class=”commentlist” id=”comments”>
<ol>
<?php foreach ($comments as $comment) : ?>
<li id=”comment-<?php comment_ID() ?>”>
<cite><?php comment_author_link() ?> vom <?php comment_date() ?></cite>
<?php comment_text() ?>
</li>
<?php if (($zaehler % 5) == 0 && $zaehler_ges < 3) : ?>
<li class=”inline-ad”>
<!– Your AdSense Code goes here –>
</li>
<?php $zaehler_ges++; endif; ?>
<?php $zaehler++; ?>
<?php endforeach; ?>
</ol>
</div>
<?php else : ?>
<?php endif; ?>
As said before: I’ve hacked this together in about a minute. One sure could solve it better. Here’s how the whole thing looks in action (did you ever see 58 Comments on a single post in a blog not even two weeks old before? I haven’t!)
Thanks for reading, I’ll keep you updated on how the whole thing will (or won’t) affect CTR and revenue. Comments on your favorite AdSense–related WordPress hacks are welcome!
Hello.
more links for that topic?
And Bye.