Google AdSense Kind Of Sucks

I’m sure there are a lot of people who have good success with Adsense, but I could never get it to work on this site. I get a lot of traffic from my WordPress plugins and some other posts. I configured my blog to show Adsense ads to incoming external visitors and ran ads for 2 years. The result? $75.

I think we’ve become blind to text ads if we haven’t already hidden them. I run Adblock Plus so never really see that many ads and even if I do I never click on them. There’s just something about allowing a third party to display content on your site that may or may not be completely relevant or trustworthy. I never click on ads so I’m not sure why I would expect other people to.

I had to close my entire AdSense account to get a pay out. The regular $100 threshold wasn’t too far away, but the way things were trending I doubt I would have ever gotten there. The last 4 or 5 months saw tens of thousands of impressions with zero earnings.

I’ve had much more success with Amazon’s affiliate links during the same time period. I think a fundamental difference is that visitors are getting to my posts because they are already interested in buying something. For example, the links in my posts about replacing the stereo in my Toyota Tacoma have a very high conversion rate. I link to all the items needed at a popular online retailer with low prices and free shipping and I get a cut of their order. I could remove the affiliate links and just put ads up, but I don’t know what’s going to show up, if people will click them and how much I’ll get (probably just a couple cents).

Maybe I just got lucky with my WordPress plugins pushing my other posts up in Google’s search results. All I know is more people bought Tacoma dash kits and wiring harnesses over clicking stupid AdSense ads.

Show AdSense to Google Search visitors in WordPress

I put AdSense ads on my WordPress plugin pages since the donation button wasn’t exactly raking in the dough. I inserted my AdSense code straight into these pages’ content. Looking through some of my stats I noticed a few of my posts got lots of hits from Google Search that would be good for ads. I didn’t want to show ads to my friends and normal readers so I went looking for a simple solution.

I borrowed some of the code used in this post, http://www.scratch99.com/2008/01/shylock-adsense-plugin-hack-to-avoid-adsense-smart-pricing/. One template function checks the referrer, if it returns true then you display your AdSense code in your post template, single.php in my case. This goes in your functions.php:

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;
}

and this goes in your post template where you want the ads to be displayed:

<?php if (function_exists('scratch99_fromasearchengine')) {
if (scratch99_fromasearchengine()) { ?>
INSERT YOUR ADSENSE CODE HERE
<?php } } ?>

And that’s it. Visitors coming in from Google and some other search engines will have whatever ad you want displayed. There are plugins that will do this all for you, but this is simple enough to build straight into your theme. The only downside is if you are using caching, but odds are only your older posts are going to be getting hits from Google. If a page happened to get cached with the AdSense code inserted then everyone will see the ads. Not really a big deal to me, but just something to be aware of.