Monday, December 22, 2008

Three Simple Tips to Boost Your AdSense Income

Google AdSense can be a lucrative source of income, and due to this big making money opportunity, everyone is making effort to have his or her share of the pie. Even now at this time, there are thousands of fresh blogs being created by some online money makers around the globe.

Creating one fresh blog for AdSense purpose is a very simple task, even if you a newbie. There are tons of info on how to setup and use Google AdSense on the internet, and the good thing is, it is free. This article too meant for that same reason, and in it, you would read few tips on Google AdSense.

Many may probably have come across these tips somewhere else, but for those have not, I hope you will find it helpful. So, here the tips.

Tips to consider when adding AdSense on your blog:

1. Ads Placement.

Place your AdSense ads likely on the spot where it easily can be seen when visitors arrive on the site. The spots where most visitors will observe for the first time are, on top and below the post title, on the left and right side of the post body and on the top area above navigation bar. Ads placed near rich body content and navigational bars are consider the best spot because visitors are likely focus on the most on those areas.

2. Use Text Ads

Text ads have more advantages than image ads. You can blend in text ads with the post content and you can squeeze more of them in the space taken up by image ads. Another advantage using text ads is better description on the ads.

3. Make you ads blend in with the site

Customize your AdSense ads to blend with the site appearance. Using to many different color on your ads can make your site look ugly and in addition on that, many visitors hate sponsored link. That is why customize the AdSense ads to blend in with the site layout and main content, and loose the ads border. Visitors are more likely to click on it thinking it is linking to another useful content source.

Though those tips can help to increase your AdSense income, you need to understand that the most important thing about making money online from a blog with Google AdSense is getting the most traffic to your blog. The simplest way to say it, the more traffic you have, the more clicks you get, the more money you can earn.

I am a part time internet marketer, who enjoy the thrills offered in the making money online journey.

Tuesday, December 2, 2008

How To Display Ads Only To Search Visitors

In the past, I’ve written about only showing Google Adsense to search engine visitors, so as to decrease the chance of being smart priced. In this post, you’ll see how to improve the technique outlined previously, so that you can make more money.

Note: Although this post is about showing Adsense to search engine visitors, it’s really about determining whether a user came from a search engine or not. The technique can be used to show search engine visitors whatever you choose, not just Adsense.

Background On Smart Pricing

By now, most people know that Smart Pricing is a penalty Google applies to Adsense accounts that don’t convert well for the advertiser, resulting in you earning only about 10% of what you’d normally earn per click.

I’m not going to go into more detail than is absolutely necessary in this post, so if you want more information on Smart Pricing, see my post on how smart pricing may cost you money or for the ultimate description, see Grizzly’s Optimization Tips for Adsense.

For now, you just need to know that only certain visitors are going to click Adsense ads and buy something from the advertiser. Who? It’s not your regular readers. It’s not the stream of visitors from StumbleUpon, Digg or Sphinn. It’s the search engine visitors.

Search engine visitors provide targeted traffic for the advertiser, which converts well. The other sources don’t. If the majority of your traffic comes from the social news sites, then you’re in danger of being smart priced. That’s why I chose to show Adsense only to search engine visitors.

The Original “From Search” Function

In my original Shylock Adsense Plugin - Hack To Avoid Smart Pricing post, I provided two approaches: one based on hacking just the Shylock Adsense plugin; another on a more generic solution that can be called from wherever you want (within the Shylock Adsense plugin, the sidebar, single.php, etc).

In this post, I’m using the second approach as it has a wider application. This was originally explained in the Hacking Shylock Adsense AND Sidebars section of the previous post. This worked by adding the following function to functions.php in your theme’s folder (wp-content/themes/yourtheme folder, where yourtheme is the name of your theme):

function scratch99_fromasearchengine(){
$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) return true;
}
return false;
}

Note: This function is based on the ‘only show search engine’ functionality from the Who Sees Ads plugin.

This function was then called from the Shylock Adsense plugin, a sidebar widget, or anywhere else you may want to, via the following code:

if (function_exists('scratch99_fromasearchengine')) {
if (scratch99_fromasearchengine()) {
INSERT YOUR CODE HERE
}
}

Obviously, INSERT YOUR CODE HERE needs to be replaced with whatever code you want to show the search engine visitors: your Adsense code if it’s in the sidebar (using the ExecPHP widget) or the Shylock Adsense code (see my original post for more details).

Problem With The Original Function

As Zath pointed out in the comments, the original function only works on the first page the visitor lands on. If the visitor subsequently navigates to another page on your site, the ads disappear. This is because the http_referer is no longer the search engine, it’s now the page where they landed on your site.

Of course, that means they no longer have the option to click an ad before leaving the site. I wasn’t worried about this, because I figured not many search engine visitors would go to another page on my site. I was wrong!

Leaving Money On The Table

According to Google Analytics, over the last month, visitors arriving at this site from a search engine read 1.54 pages per visit. That means that every second visitor is clicking another page.

Every second visitor! That means I could be serving up 50% more ads to the sort of visitor who is likely to click ads!

I decided I better change the way I was doing things, so that search engine visitors see ads on every page they visit at my site. Fortunately, this is fairly easy to do, by setting a cookie that identifies search engine visitors.

New “From Search” Function Using Cookie

Here is the solution I’m now using on this blog.

First, the you need to add some code to functions.php in your theme’s folder (wp-content/themes/yourtheme folder, where yourtheme is the name of your theme). The following should be added immediately before the ?> at the bottom of the file:

$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) {
setcookie("sevisitor", 1, time()+3600, "/", ".scratch99.com");
$sevisitor=true;
}
}

function fromasearchengine(){
global $sevisitor;
if ($sevisitor==true || $_COOKIE["sevisitor"]==1) {
return true;
}
return false;
}

Note: In the setcookie line, you must change “.scratch99.com” to your own domain!

The fromasearchengine function can then be called from wherever you want to use it (to check if a visitor is from a search engine or not). This is explained further below.

Notes About The New “From Search” Function

The code that detects whether the user is from a search engine has been moved out of the fromasearchengine function, into the body of functions.php. This means it will only run this code once per page load, rather than every time the function is called, which may be several times per page load (I call it from Shylock Adsense and from the sidebar).

Also, the $sevisitor variable was introduced because the cookie can’t be detected on the first page view. The cookie is set on the first page view, but the $_COOKIE function won’t see it until the next page view. The above code checks whether the $sevisitor variable is set (ie it’s the first page view) or whether the cookie is set (ie it’s a subsequent page view).

I had one problem with setting the cookie via WordPress, but it doesn’t affect the final solution above, so I leave that for a future post.

Calling The New “From Search” Function

To call the new fromasearchengine function from Shylock Adsense, edit the shylock_adsense.php file which comes with the plugin. Look for the following code (on line 325 in version 1.2):

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

and replace it with:

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

if (function_exists('fromasearchengine')) {
if (fromasearchengine()) {

Then go down to about line 364 and look for:

return $output;

and replace it with:

} } return $output;

Note: I’ve just noticed that the Shylock Adsense Plugin has been renamed to the WhyDoWork Adsense Plugin. The name change seems to be the only difference, so the line numbers above are still correct, but the function is called whydowork_adsense_filter instead of shylock_adsense_filter.

Alternatively, to call it from a PHP sidebar widget or somewhere else (such as single.php), you would add the following code in the appropriate place:

if (fromasearchengine()) { ?>
INSERT YOUR CODE HERE

replacing INSERT YOUR CODE HERE with your Adsense code or whatever else you wanted to show the search engine visitor.

Final Thoughts

Using this technique, to set a cookie to identify search engine visitors, then only serving Adsense to such visitors, should help you make more money, while avoiding being smart priced. However, as always, it pays to experiment with Adsense and monitor the affects on your income.

Of course this technique will have other applications as well, allowing you to serve whatever content you like to search engine visitors. I hope some of you find it of use.

Shylock Adsense Plugin - Hack To Avoid Smart Pricing

In my last post, I talked about Adsense Smart Pricing and how blogs can avoid it by only showing ads to search engine visitors.

One option for WordPress is the Who Sees Ads plugin, which has the ability to do this. I prefer the Shylock Adsense plugin for the reasons given in my last post: automatic placement of ads; no need to enter placeholder in each post; easy to move ads from, say, top right to top left, etc.

The problem with Shylock Adsense is that although it can show ads on old posts only (mostly search engine traffic), there is no option to show ads only to search engine traffic. I really wanted this functionality, so I added a few lines of code to the plugin to enable it. In this post I explain how to do it.

Note: If you make these changes, you will lose some clicks and a lot of impressions. If you are currently smart priced, these changes should help fix that (after about a week), so you are likely to earn more. If you are not smart priced, you may actually lose money from these changes, although it safeguards you from the danger of being smart priced in future. Read my last post about Adsense Smart Pricing and blogs for a better understanding of the issues here. For my site, I’ve concluded that I wasn’t already smart priced. I do not seem to be losing any clicks, but your site may be different.

Hacking Shylock Adsense ONLY

If you are only using Shylock Adsense to show ads, then this section is for you. If you have Adsense in other places, such as the sidebar, skip this section and continue to the Hacking Shylock Adsense And Sidebars section.

First, edit the shylock_adsense.php file which comes with the plugin. Look for the following code (on line 325 in version 1.2):

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

and replace it with:

function scratch99_fromasearchengine(){
$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) return true;
}
return false;
}

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

if (scratch99_fromasearchengine()) {

Then go down to about line 364 and look for:

return $output;

and replace it with:

} return $output;

Upload the edited file to the wp-content/plugin directory on your server, overwriting the original file.

If you experience any problems, simply upload an unmodified version of the shylock_adsense.php file, replacing the one you’ve changed.

Shylock Adsense will now only show ads to search engine visitors. Any existing limitations will still be in place, but there is no longer any need for them - if the plugin is set to show ads after a certain number of days, you should change this so they are shown immediately.

Note: The scratch99_fromasearchengine function is based on the ‘only show search engine’ functionality from the Who Sees Ads plugin.

Hacking Shylock Adsense AND Sidebars

Note: If you only show ads using Shylock Adsense, the previous section is for you, NOT this one.

I display ads in my sidebar, as well as in the post body. There is little point in hacking Shylock Adsense so that ads only appear to search engine traffic in the post body, if regular visitors can see them in the sidebar! Therefore, I came up with a solution to restrict ads in both places.

If we are going to use it from multiple places, the best place for the function checking if visitors are from a search engine is not in the Shylock Adsense plugin. What if we stop using the plugin in future and disable it? Then the function will stop working in other places, such as the side bar. I decided to place this function in the functions.php file in my theme folder.

Note, this is not perfect, as the functionality will be lost if the theme is changed.

1. Functions.php

Go to the wp-content/theme/yourtheme folder (where yourtheme is the name of your theme) and make a copy of the functions.php file (in case things go wrong). Then edit the file, go to the very bottom and replace:

?>

with:

function scratch99_fromasearchengine(){
$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) return true;
}
return false;
} ?>

Upload the edited file to your theme directory on your server, overwriting the original file.

2. Shylock_adsense.php

Edit the shylock_adsense.php file which comes with the plugin. Look for the following code (on line 325 in version 1.2):

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

and replace it with:

function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;

if (function_exists('scratch99_fromasearchengine')) {
if (scratch99_fromasearchengine()) {

Then go down to about line 364 and look for:

return $output;

and replace it with:

} } return $output;

Upload the edited file to the wp-content/plugin directory on your server, overwriting the original file.

If you experience any problems, simply upload an unmodified version of the shylock_adsense.php file, replacing the one you’ve changed.

3. Sidebar Widget

To do this, you need to have a widget with can execute php code. I use Otto’s ExecPHP plugin, but there are others available.

If you don’t have a plugin which can do this, download ExecPHP and install it. This will add a PHP Code 1 widget to the Presentation - Widgets page in the Admin area. Drag this widget to wherever you’d like the ads to appear, click on the configure icon and enter the following into the text box:

if (scratch99_fromasearchengine()) { ?>
INSERT YOUR ADSENSE CODE HERE

replacing INSERT YOUR ADSENSE CODE HERE with your Adsense code.

Close the text box, Save Changes and you’ll now have ads which appear in the sidebar for search engine visitors only.

4. Other Places

Although I’ve done this in a sidebar widget, the same code should work equally well in sidebar.php - or for that matter, wherever you want to use it (maybe single.php or index.php).

Testing The Changes

This applies to both hacks above. You should no longer be able to see Adsense on your site when you visit it as you normally do. Now you need to visit your site via a search engine to see if the ads appear.

You could do this by searching for your site name or url, or you could search for a relatively obscure phrase from one of your posts, contained in quote marks (eg “I’ve concluded that I wasn’t already smart priced”).

Once you find one of your posts in the search results, click it, go to your site and see if ads appear. If they do, you’ve hacked the plugin successfully.

But Wait There’s More

While this post has been written from the perspective of serving Adsense ads to search visitors only, you could use this technique to show anything to search engine visitors - other ads, custom messages, you name it…

Final Thoughts

This hack should help you avoid being smart priced by Adsense. I hope you find it of use.

I’ll be contacting the author of Shylock Adsense to see if this functionality can be added to the plugin in future. In my view, this would be a logical extension to what is already a great plugin, especially as more people become aware of Adsense Smart Pricing.