Maximize Adsense By Only Showing Ads To Search Engine Visitors Even With WP Super Cache For Your Wordpress Blog

Stumble!Stumble It!     Reddit!     Digg It!Digg!     DeliciousDel.icio.us     Tipd     FB Facebook

I recently spent some time working with Adsense on MyWifeQuitHerJob.com so I thought I’d share with you some of the optimizations I’ve made with Google ads on this blog. As many of you may have noticed, this blog makes part of its revenues from Adsense ads which can be found directly above and below the content. But depending on how you arrived at this site, you may not have noticed the ads at all.

Because the income I make from Adsense ad clicks is directly related to the conversion rate of the people seeing the ads, it is to my benefit to only show these ads to interested parties. If too many ad impressions are shown but do not lead to conversions, Google will reduce the payout per click for my entire site. This phenomenon is know as “smart pricing”. In this case of MyWifeQuitHerJob.com, the best way for me to maximize conversions is to show Google Adsense ads only to search engine visitors and this is exactly what I do.

Now if you look online, there are many articles already posted on how to show ads only to search engine visitors so why am I covering this topic yet again? The problem is that none of these tutorials cover how to do this if you cache your website.

WP Super Cache And Other Caching Plugins

Most of the solutions out there rely on php modifications to the Wordpress template in order to serve Adsense ads only to search engine visitors. However, if you run any sort of caching plugins for your wordpress blog, you will run into problems with dynamic code.

The reason lies with the way caching works. In the case of the WP Super Cache plugin, the plugin makes an exact copy of your html code and saves it into a file on your server. When many visitors hit the exact same article on your site, the static copy is served instead of the regular version. As a result, many of the CPU intensive PHP and database operations are avoided. In fact, caching is one of the best ways to speed up your website without having to upgrade your server and everyone should be doing it because it’s quick, easy and free.

The problem with caching however is that because a static copy of your site is being served to the end user, dynamic content using php can not be used because the php interpreter is not even being run when a cached copy is served. In short, many of the php based solutions to serve Adsense ads only to search engine visitors will not work when caching or the WP Super Cache plugin is used. In addition, many other plugins that rely on dynamic content can not be used with the WP Super Cache plugin unless it is run in half-on mode.

A Javascript Solution

Even though the WP Super Cache plugin serves a static copy to the end user, one of the best ways to still serve dynamic content is through the use of javascript. Javascript works in such a way that all of the javascript code is run directly on the client’s computer. As a result, you can still serve static html files to the end user and run dynamic code.

It is through javascript that I’m able to serve fully cached files and still run my little script to serve adsense ads only to search engine visitors.

My Javascript Code

Here is my little javascript snippet below which is all contained in a .js file which I’ve named adsense.js.

var ref = document.referrer;
var sevisitor;
var SE = new Array('web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '.yahoo.','/url','/search','.google.','.ask.','.baidu.','.bing.','.aol.','.answers.');
for ( var source in SE){
var match = ref.indexOf(SE[source]);
if (match !=-1) {
sevisitor=true;
}

function adsenseTop(){
if (sevisitor){
var large = '<script type="text/javascript"><!-- \n\
google_ad_client = ""; \n\
/* 336x280 Content Top, created 7/24/09 */ \n\
google_ad_slot = ""; \n\
google_ad_width = 336; \n\
google_ad_height = 280; \n\
//--> \n\
</script> \n\
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> \n\
</script> \n\
';
document.write(large);
}
}

Then in my single.php file under my Wordpress theme, I add the following lines where I want to display my Adsense ad.

<script type="text/javascript" src="adsense.js"></script>
<script type="text/javascript">adsenseTop();</script>

To all experienced web programmers, this script probably comes across as a big joke. However, many bloggers are not programmers so I will explain what is going on. In a nutshell, the script detects the referring website and stores this value into the variable ref. It then checks to see if the referring URL matches any of the search engines. Naturally,I check for all of the popular ones including even Baidu. If the referring URL matches, then I set the sevisitor variable. Based on the sevisitor variable, I then use javascript to output the Google Adsense code.

Smart Pricing

Ever since I started implementing this code, MyWifeQuitHerJob.com click payouts have increased steadily. Showing adsense ads only to those searching for relevant information makes sense. You spare your regular readers from having to see the ads and you capitalize on those who are in search of answers. It’s a win win situation.


Did you like this article? There are many more articles like this on entrepreneurship, kids and money and how to open an online business on this website. Read about our journey how we went from earning 0 to 100 thousand dollars in 12 months with our online business. Looking for some laughs? Read about some of our crazy customer stories.



Ready To Get Serious About Starting An Online Business?

If you really want to start your own online business and quit your day job, then you absolutely have to check out my guide on How To Create A Profitable Online Store In 5 Easy Steps.

In this guide, I reveal the steps that my wife and I took to earn 100 thousand dollars in the span of just a year. Best of all, it's free!



Do You Want To Make Your Business Legit?

Let's face it, not everyone has an MBA and not everyone is educated in the mechanics of starting a business. Getting past all of the government red tape can be intimidating especially if it's your first time starting a business.

My Ultimate Small Business Startup Guide will provide you with step by step instructions on everything you need to do in order to make your business legit.



Receive Free Updates!

The above two guides are just a taste of what MyWifeQuitHerJob.com has to offer. Get motivated! Follow our journey how we went from earning zero to $100,000 in the span of one year with our online store! MyWifeQuitHerJob.com delivers quality articles on building wealth, entrepreneurship and how to start and run a business.

Sign up for free updates now!
Enter your email address:

Stumble!Stumble!     Reddit!     Tipd     Digg It!Digg!     DeliciousDel.icio.us     FB Facebook

RSS Feed Get Free Updates Via RSS   RSS FeedGet Free Updates Via Email   TwitterFollow Me On Twitter

Similar Posts

Have you read these?

5 responses so far

5 Responses to “Maximize Adsense By Only Showing Ads To Search Engine Visitors Even With WP Super Cache For Your Wordpress Blog”

  1. Daveon 26 Jan 2010 at 9:47 am

    Solid concept thanks for sharing, your tutorial will make it easy to implement. I’ve found it difficult to see solid CTR from blog adsense ads, primarily b/c many visitors are repeat coming from either a feedburner subscription or a RSS reader.

    Gonna go give this a try.

  2. [...] Maximise Adsense by only showing ads to search engine visitors at MyWifeQuitHerJob.   [...]

  3. [...] This post was mentioned on Twitter by CouchSurfingOri, mywifequit, Money Matters, MMarquit, Wayne Liew and others. Wayne Liew said: RT @mywifequit Only Show Ads To Search Engine Visitors Even Though Your Blog Is Cached http://su.pr/3lUUzY [...]

  4. Kikolanion 29 Jan 2010 at 6:39 pm

    Great tip! I see it works too, as I just searched your post and came in through Google to see the difference. I think I’m definitely going to try this for my site for a bit to see how it does. Thanks for the great how to!

  5. Mike Kingon 31 Jan 2010 at 11:44 pm

    This seems like a useful technique to customize content for searchers verses other browsers. I assume this is also how some sites recognize stumbleupon visitors and other social media specific visitors.

    Anyway, I can’t seem to get mine to properly call the javascript I have. I’ve followed your instructions to make my adsense.js and called it with the two lines in my single.php theme file but can’t get it to actually do anything. I have a else method to write content to the page even for direct visits but don’t seem to get any results. Perhaps you can elaborate on how you made the call from the single.php file and is your adsense.js file listed in its entirety? I’ll have to look for ways to test this since I can’t tell what isn’t working, it simply doesn’t output anything even though my script code works if I add it directly at the html of a page.

    Thanks for any more tips you can offer.

Trackback URI | Comments RSS

Leave a Reply

Quit Your Job! Be Your Own Boss!
23097
Monthly Readers

Get motivated! Follow our journey how we went from earning zero to $100,000 in the span of one year with our online store!

Sign up for free updates now!

Enter your email address: