Friends don't let friends see adverts

This post has been a long time in the writing. Ever since I started advertising on my blogs my strategies have been tweaked continuously so consider this post a snapshot description of what I’m doing with Adsense advertising now. This is a long post, but read through it. The plugin I use to do most of this stuff is linked near the end.

Last year at the IT@Cork Web 2.0 conference, Gavin mentioned that he earns enough off his blogs to pay for his hosting, and I thought to myself that it would be handy to have an extra bit of cash to do likewise. I didn’t do anything about it until July when I signed up for an Adsense account and put some ads on the site. Things were slow that month but they’ve steadily improved to the point that it’s a reasonable second income now.

At last year’s WordCamp in San Francisco, one of the talks was about monetizing your blog. It was a fascinating talk with a great discussion afterwards and I brought home some good ideas:

  • Don’t show adverts to your friends. They are the people who visit your blog and leave comments. They’re not going to click the ads anyway.
  • Position matters. Right underneath the post title and above the content is the best place on a blog to put an advert. (Thanks Matt!)
  • Go as wide as you can.
  • Experiment with ad colours, borders and sizes. Don’t accept the Google defaults. Blend your ads or make them stick out. It all depends on your blog.

Since then I’ve developed my ad serving strategies further:

  • I love when people comment, and I’m honoured when people subscribe to my blog. Therefore I won’t show my RSS or email readers adverts. If you like what I do enough to subscribe I won’t burden you with advertising. You’re my friend.
  • Don’t show adverts on the homepage.
  • Adsense Injection is great for putting adverts directly into posts.
  • Monetize your archive. Any post older than a month gets adverts.
  • Don’t show adverts to Digg, Delicious and Stumbleupon visitors.
  • Identify where most of your “just passing through” traffic is coming from and show them adverts, except for social bookmarking websites of course.
  • If my blog showed you adverts, I’ll tell you “Don’t like adverts? Leave a comment and they disappear.” below the comments form. At least one person has commented favourably about that.
  • Fill the competitive ad filter with low paying URLs. If you’re still showing ads from helium.com then you’re missing out. If your daily eCPM isn’t at least $5 you’re not making the most of your advertising. Subscribe to notspam.org to see which MFA and low paying sites go into my competitive ad filter. I’ll talk about the competitive ad filter in more detail in a future post.
  • Set an hour long cookie for users from search engines. Blogs have a notoriously low attention span for most visitors but if they click to the front page, show them a few more ads.
  • I use Kontera too but the returns from that have been very disappointing. One of my posts has an AuctionAds unit in it. You’ll see that no matter what because I’m testing it for a few weeks and the post in question is almost always only hit by visitors from Google.

I run advertising on my photoblog, In Photos dot org too but the rules there are a bit different:

  • Each post has a big image, pushing the text description below the fold. That’s not ideal for displaying adverts so I use the left sidebar to show a 600px high Adsense skyscraper unit.
  • Show the sidebar advert even on the homepage. It’s not an ideal location so better give it as much exposure as possible.
  • It’s difficult to attract visitors to a photoblog. I wrote 11 seo tips for your photoblog to outline some of the ways I draw traffic in. The biggest mistake is definitely not writing about your photography. If there is no text, how can the search engines figure out what your blog is about?

I’m not the only one only showing adverts to selective visitors. Recently Ben Gillbanks had a great post on increasing Adsense earnings that says some of the same things I summarised here.

I haven’t tried it yet, but the who sees ads plugin from Ozh does most of the same checks I do. That plugin won the WordPress plugin competition so congratulations to Ozh on winning!

The No Adverts for Friends plugin

Announcing my shiny new, rough as anything No Adverts for Friends plugin! This plugin adds new commands that you can use in your templates. Use them to surround your Google Adsense or other advertising code.

The No Adverts for Friends API:

  • is_regular_user() – returns true if the visitor has left a comment or is logged into your blog.
  • is_whitelisted_site( $url ) – returns true if $url is in a pre-defined list of friend sites like Digg, Delicious and StumbleUpon.
  • is_old_post() – returns true if the current post is over a month old.
  • is_searchengine_user() – if a user comes from one of the listed search engines or this is an old post return true.

Each of the API calls depends on the one before it returning a favourable value. For example, is_old_post() won’t return true if is_regular_user() returned true, no matter how old the post is.

Example usage:
<?php if( is_searchengine_user() == false ) { echo "Google adsense code goes here"; }?>
Edit single.php in your current theme and add that code somewhere within the loop. Now either visit an old page on your blog or use a Google search query to bring you to your blog. Hopefully you’ll see the text “Google adsense code goes here”. Replace this text with the Google Adsense Javascript.

Download

Install

  1. Rename both files to .php and place friendsadverts.php in your plugins folder. If you use WP-Cache copy wp-cache-phase1.php into plugins/wp-cache/ overwriting the file already there (make a backup first!)
  2. If you use WP-Cache copy the $nevershowads and $passingthrough arrays from friendsadverts.php into your wp-config.php. They’re needed by WP-Cache which kicks in well before plugins are loaded.
  3. Activate the “No Adverts for Friends” plugin from your plugins page and modify your templates using the new API.

Well, you’ve read this far. If some of the advice in this post helps you, if you like this plugin, if it improves the user experience of your regular visitors and maybe even increases your advertising revenue please consider uncommenting the add_action() command at the start of friendsadverts.php. The donnchas_happy_happy_notice() function prints a message in your blog’s footer saying you use this plugin and links back here.

Thanks John for bugging me to write this up. Hopefully I’ll see you at next year’s WordCamp!


You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos to explore too!

"Friends don't let friends see adverts", 5 out of 5 based on 1 ratings.

88 thoughts on “Friends don't let friends see adverts


  1. With a combination of ad blindness and ad blockers, there’s not much chance of friends or anybody else seeing the ads.

    In five years I think I’ve clicked one adsense ad. And that was just testing…


  2. I think it should be mentioned that you should try your design with a powerful ad blocker and make sure it still works. The only thing worse than a lot of advertising is finding the whole place a mess because the design uses the ads widths and heights without hardcoding them and everything breaks when they’re taken out.

    I wonder why the suggestion of not showing ads to social sites. Considering the stupidly high attrition level of these (over 90%, IIRC) wouldn’t it be a good idea to have some adverts there? At least one from adSense, which may be relevant to what the user is looking for.

    It’s also a good thing to revisit the decisions you make, as changes in your statistics may affect them. If you start getting more attention you may want to take some of the ads away, as the others may be reporting enough to make the whole thing worth it.

    Lastly: There is one kind of publicity nobody ever addresses and I think it’s high time someone did. Old-fashioned, traditional paid publicity (like The Deck’s, probably). Where a sponsor pays to have their ads put somewhere in your page. This is a place where some education is sorely needed (sponsors tend to really like flashing, moving ads) and they don’t understand about ad blockers because they don’t care about clickthrough anyway.


  3. I would agree with jack. Since I knew adsense I have never clicked anywhere just one reason I understand what it is ment for.


  4. eduo – the users who come from social bookmarking sites are generally web savvy and they’re more valuable as prospective diggers or stumblers who will make a particular post more prominent on their sites.
    As well as that, they may blog the post too, adding lovely page rank to the url.

    Anyway, I’ve never had a post appear anywhere near the front page on Digg or any other site so this is all theoretical and repeating what I’ve read elsewhere!


  5. I like this idea, but my AdSense income is not big enough to warrant going through this type of trouble — yet. I think this is great to show more intrusive big box ads to non-friends.

    Also, perhaps there is a happy medium where I can show less intrusive ads to friends and more intrusive ads to non-friends.


  6. Pinyo: There is another very important rule: If you’re not getting much from your advertising consider taking it out completely until you build up some user mass.


  7. Donncha: That’s a valid point. I was looking at it from the other end. A huge amount of “social visitors” leave without a second glance (usually crapping on your server on the way out :) but you are right, they might link back to you and those 1% are worth not showing ads to the whole.


  8. Carson – you won’t see any adverts now at all because you’ve commented, but you wouldn’t have seen any Adsense adverts on this post because it’s a brand new post.

    Delete the ocaoimh.ie cookies in your browser and visit one of my old posts and you’ll see lots of adverts!


  9. I’m sure there are some great ideas in this post, but I have no idea because I couldn’t read it.

    Dark grey text on a royal blue background? What the…? Am I missing something? Are my browsers rendering funny? (I tried two.)

    Really hard to read.


  10. Matt – that’s weird, the blue should only show in the border. The rest is a white background. You could always subscribe, then you’ll be able to read it fine! :)


  11. Hello, Can you give me more Example usages?
    Only search engine users and first visit users should become google ads. It’s your plugin compatible with adsense manager?
    Thx
    Freetagger


  12. This is quite possibly the worst advice I have ever heard about advertising and I’ve been blogging for over five years. Way to get it linked from the WordPress dashboard though.


  13. Donncha – Hm. I beginning to wonder if it’s a Mac browsers issue. I ran across another WordPress theme with the same problem. That guy worked some CSS mojo and fixed it. (Dunno what he did–I lack CSS mojo.)

    What’s even weirder is it looks fine now. I didn’t change anything–didn’t flush caches or anything. Just came back to check comments (which looked fine before) and everything looks fine. Nice and readable. Go figure.

    And I was right: There are some great ideas in there (which I can really use, being new to blogging).

    “You could always subscribe, then you’ll be able to read it fine!”
    Why, I believe I will.


  14. Mattt (sorry, I forgot the last t in my first reply!) – stranger and stranger. I’m just glad my blog displays fine for you now. I’ve viewed this blog in Safari and Firefox on the Mac and haven’t seen the problem you saw. The mind boggles! Thanks for subscribing, hope you enjoy everything else!

    Freetagger – I’m not sure about adsense manager but I’m sure if you knew your way around the code you could add my commands in the right places to make it behave. I’ll add more examples tomorrow when I have more time.

    James – that is quite possibly the worst critique of a post I’ve read and I’ve been blogging for 10 years! ;)


  15. Donncha: I do not see any ads on this page! That is before writing this comment! And trust me, this is my first visit to your blog! Not that I really want to see ads, but I am concerned if the plugin may work counter productive!


  16. Vikas – that’s fine, you weren’t going to click an advert anyway were you?

    As I said before, the post is too new to show adverts. Wait until it’s a month old, then you’ll see ads plastered all over it if you remove your ocaoimh.ie cookie. :)


  17. I’ve been trying to weigh the ups and downs of increased revenue (read: actually making enough to cover my hosting) from adding more ads to my site against angering my few hundred regular readers and I think this simple plugin just gave me my solution.

    This is a wonderful plugin, thanks!


  18. Personally, I don’t mind seeing ads. Adsense ads don’t bother me too much (although I usually don’t click on them) and banner ads are fine as long as they’re quiet and don’t follow me around the screen.

    What I can’t stand, however, are those damned context links, the ones that underline a word and have the js popup. I usually avoid sites that do that.

    Another type of site I avoid are those that have the paid posts. “This post is sponsored by….” If a blogger has to resort to that tactic, then what makes anything they write about worth my time?

    Personally on my site I have Adsense on some older posts (added by hand when I get around to it.) I’ve only made a few dollars, but I only have a dozen or so on site.

    Since I write a lot about TV shows, I put Amazon links on my site, and it’s really my only source of revenue. But since it’s related to what people are comming to my site to read about, it can also be effective.

    And it’s not in-you-face.

    As for ads in feeds, I find that crass. Like you said, they’re ‘friends’ or regular readers. They deserve better.


  19. Only search engine users and first visit users should become google ads, can you please created the code for me? I cant php, and when I use your Example, become only search engine visitors ads, but first visitor should always become ads to see.
    I hope you unterstand my grap english.


  20. Freetagger: instead of using the “is_searchengineuser()” command, replace it with “is_regular_user()” and it will show adverts to anyone who hasn’t left a comment on your blog.

    My functions don’t support showing ads to first time visitors but the above should do.


  21. Thanks for this. I’ve been wrestling with what to do about ads for a year now — and I’ve left them off because of not wanting to inflict them on my regular readers and actual friends.

    This leads me to reconsider my no ads (and consequently, no advertising income) stance.

    Much appreciated. I’ll spread the word.


  22. I don’t run ads on my personal blog (not enough traffic to really bother), but I do run ads on an extremely popular site I run. With a server bill of over $100 month, I’ve been forced to (plus it’s nice to have a little extra cash in my pocket).

    However, I did my very best to while put them where easily seen, not make them stick out like a sore thumb.

    I also don’t put ads on the site’s forums for registered users, just for guests along with a message along the lines “Don’t like ads? Register for a free account”.

    There’s a fine line to walk between plastering your site (I could probably do better money wise, but at the cost of annoying my users) and just making a tidy income.


  23. Ozh – I’ve been meaning to, but time is the killer..

    Rico – Ah yes, that was a great article. I read that months after it was written and it certainly gave me confidence that I was doing the right thing!


  24. Great Plugin. I’m searching for that kind of plugin and thanks I found It. Yeah, your friends or our friends will not click the ads but to read, get an ideas and information and leave comments to our blog. They are a publisher jut like you.


  25. I’ve been dugg 7 times and on slashdot 3 times and I agree with your findings.

    The CTR drops through the floor when you get traffic from these sources, it’s not worth showing them ads as they will

    1) Complain about it
    2) Ignore the article (especially if you have ads IN the content)
    3) Leave quickly
    4) PROFIT!

    Anyway, better to retain some of them as RSS subscribers and repeat readers than show them ads and earn a few extra bucks.

    You gain more in the long term.

    Another thing you might consider adding is a switch to change the block, I put smaller ads in recent posts rather than none…and then switch them out to large rectangles when they are a month or so old (the highest CTR unit).

    Good work anyway :)


  26. Why do the functions rely on each other? If I have a function to test whether a post is old — is_old_post() — the only thing I’d want it to return is true if the post is old or false if the post is new. Whether or not a user is a regular user should have no bearing on whether a post ir old or not.

    This way, I can create the combinations I want in the code without having to worry about dependencies.


  27. Flexo – that’s just the way it works, but you’re free to modify the code.

    Originally I did have the functionality separate but I found I was doing all the same checks all the time so I made the hierarchy of functionality that exists there now.


  28. Hello there,

    I can’t see your blog either. Its all blue and sometimes a white field (mostly replies from Donncha). Or is this really only for friends?


  29. surprise!! After I posted my first comment the main turned white and the sides are blue as it should be. Maybe its javascript!!!


  30. Heiste – I think it’s a bug somewhere. I saw it too last night but after I deleted my WP-Cache folder the regenerated page was fine. When you posted a comment it cleared the cached copy of this page on my server and you saw the proper one again.
    Annoyingly, no error appeared in php_errors so I’m not sure why it happened.


  31. I don’t get enough traffic to do tests and be sure about the result, but I was wondering do you think that lots of ads to new visitors would make them less likely to revisit?

    I have never seen any ads here either, but then about I use very strong ad blocking. It is amazing what using *ads* as one of the filters does :)


  32. Michael – I’m sure it would turn off some people visiting again but there’s so little chance a visitor from Google will subscribe or bookmark the site that I think I’m losing little.


  33. It just occurred to me that the Landing Sites plugin could be used usefully in this regard…

    Add a conditional so that if visitors turn up *only* from search engines they get to see the ads, everyone else (bookmarks, Digg, SU, rss) gets none of that…very simple to set up.

    d


  34. Dotme – that would be fine if I knew them all but I don’t.

    The definition of “friend” here is a little broader than the normal “meet you at the bar for a drink” type definition! :)

    This way is much better.


  35. I saw a 500% increase in AdSense revenue after implementing my own Landing Sites tip inspired by your post. Admittedly, it was only $1.26 the day before. Better than a poke in the eye though, and $5 a day could amount to $1500 a year taking holidays into account etc

    db


  36. Hi,
    i just stumbled upon your plugin and it sounds promising. i will try it and see how the people react.
    i also liked your thoughts about how and where to place ads on the page. guess i’ve a lot to change around my page. ;)

    greets


  37. You can show me ads all day long. I realise you have costs to run your blog. Why shouldn’t you make a few bucks to cover your costs?


  38. I’ve been looking for a way to do this. Finally I stumbled on this page via the admin page for wp-super-cache. This is awesome it seem to solve every part of advertisement I need to have. I will download it and test now. Let you know later on if I love it. Can this plug work for my blog featured by WordPress MU?


  39. Hey Donncha,

    Hope you’re having a lovely Christmas!

    Thanks so much for this. I’m not a coder myself as you know, but I can stumble around existing code a little bit, so I hope you don’t mind that I stole some of your code and inserted it into Adsense Injection’s code so that I now have a plugin which automatically inserts ads into posts older than 1 month but recent commenters won’t see them…

    I think it all works, see BifSniff blog for it in action at the moment. It’s a work in progress but I haven’t found any issues yet…

    Thanks again, it’s taken me a long time to get around to having a solution I’m happy with – wouldn’t have been possible without your brilliance :)


  40. Hi
    You make some interesting points there.
    I am too new to blogging to comment on that score, however I pay my hosting costs and quite a bit more from just a couple of pages on my photo website. Around 20% of that revenue comes from Adsense link units “below the fold” on pages with single pictures, against an eCPM for those units of around $3.00.
    In fact I have recently discovered that link units in pure HTML pages earn about 50% more than the same units in PHP, and more than ads. I do wonder where that leaves my blogs?

    In terms of photos to go into the blog, as an experiment I have simply written a script which generates the formatted photo content with text descriptions. I simply copy the source into a blog content page – experiments at http://myeasierway.com/cgi/wp/?cat=8.

    Jerry


  41. I operate 4 blogs: one family, one hobby (geeking), and 2 business-related.

    Blogging is so cheap that I just absorb the costs elsewhere. I guess if I suddenly became a celebrity blogger I might be tempted to monetize the blogs.

    I liked the spoof article that was titled “how to be a 6-figure blogger”. The punch line was “get a 6-figure job and blog at work”.


  42. I’ve put your example code in my single.php file and I see the line “Google adsense code goes here” whether I visit the page from my blog or from Google. What am I doing wrong?


  43. You have some good advice, but I don’t understand why you wouldn’t show ads on the home page, or to visitors referred from search engines and social bookmarking networks. The home page is the most visited page; not putting ads there is going to reduce your income. Don’t you deserve to be paid back for your hard work?

    The “Blogs have a notoriously low attention span for most visitors” isn’t the fault of the medium; it’s because many blogs aren’t interesting or useful. They can hold attention just as well as a traditional website, depending on what you write/code/photograph.

    I don’t mind ads myself; the Internet is one humongous advertisement. Google AdSense isn’t doing its job if advertising is a burden to your readers, though. Ideally the ads would compliment what you write by being contextually relevant and a resource to your visitors. Often it isn’t so, unfortunately.


  44. Man, This plugin sounds awesome. I am gonna give it a try. I was on my way learning more on Adsense and found this one.

    I had thought I was making good from Adsense, but my eCPM is way below $5 :( That means I have to optimize, and have lots to learn :)

    Subscribed via feed :)

    (I love to see the Subscribe to comments tick box below the comments box. Its a great way to keep track, thanks for adding it here :) )


  45. Hi,
    I love the concept of this plugin, but need some help.
    I want to display ads to everybody but visitors from 2 websites.

    I am guessing I need to insert url’s here:
    $nevershowads = array( ‘stumbleupon.com’, ‘del.icio.us’, ‘digg.com’ );

    But what do I need to insert in single.php to make it the way I want?

    Also, I would need instead of
    { echo “Google adsense code goes here”; }

    Please answer with code in comments or email me. I will be happy send few bucks by paypal if this takes more than 1 minute.

    Thanks a lot in advance,
    Marko


  46. Just to add missing line in previous comment

    Also, I would need instead of
    { echo “Google adsense code goes here”; }


  47. Does this work on 2.8+? I’m trying it on a site of mine using the is_old_post and even the search engine like the example, and the test text shows regardless if it’s a new post or old post. Thanks!

Leave a Reply

Loading Facebook Comments ...