Adsense is one of the easy and effective way to monetize any website. I have been using Adsense ever since I started blogging and it gave me good returns too!
In my last post about Adsense, I had summarized some of my observations from using Adsense to monetize this blog. Long back, I shared a PHP code snippet to insert Adsense based on the post length. Today In this post, I’m sharing few more tips on Adsense, which I think might helpful to you. Here we go:
I assume that you are using WordPress and you know how to edit WordPress theme files. If not, you are using these code snippets at your own risk!
1. Target Adsense content and get better ads
Your blog might have n-number of things – comments, sidebars, ads, etc – apart from the main content. The user comes to your site to read your content, not the n-number of other things. So, it is better to target the main content to show best matching ads, which in turn increase the click through rate. This is called as Adsense Section Targeting. It’s an approved method from Google to improve the advertisement shown on your website.
For Section targeting, all you need to do is, put the following code snippet in your blog/website.
<!-- google_ad_section_start --> Your main content / blog post. <!-- google_ad_section_end -->
WordPress users can add the above snippet in their single.php file in appropriate place.
2. Show Adsense only to the search engine traffic
If you want to show the advertisements only to the users who are coming from a search engine (Google or Yahoo!), use this snippet. For wordpress users, in your single.php file place this code in appropriate place.
<?php
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source)
{
if (strpos($ref,$source)!==false)
{
echo 'PLACE ADSENSE HERE';
}
}
?>
3. Add ad only to the older posts
In case you want to show ads only on the posts which are older than, say 10 days. This way you can hide adsense to the regular readers of your blog and still show advertisement to the people who are looking at your old posts. Well, here’s the code snippet for that.
<?php
global $post;
$DAYDIFFERENCE = 10;
$postDate = $post->post_date;
$currentDate = date('Y-m-d');
$diff = abs(strtotime($currentDate) - strtotime($postDate));
$diff = ceil($diff/86400);
if($diff > $DAYDIFFERENCE ){
echo 'PLACE YOUR AD HERE';
}
?>
{ 2 comments… read them below or add one }
Thanks for the tips.
Unrelated to the above post – In this blog, you show snippets of recent posts and again the footer has a section of recent posts. A section of related posts may be more helpful.
you are welcome, JB!
btw, I was having the related posts feature before, but disabled it because it confused the search engines and the search results were messed up. That was the only reason for not having the related posts in this blog.
Anyway, I’ve added the related posts now. Hope your experience with this blog gets better.
{ 1 trackback }