Discover effective ways to monetize your website with top Google Adsense alternatives for increased.

Other Random Posts!

26 Comments

  1. Great advce – I tried it – works perfect! Thank you!!

    I have exactly the same question like Shawn. I tried to copy the same code after the first one and only replaced the count number (from 0 to 2), but in that case no ads appear on the screen at all.

    What could be the correct code in that case?

  2. Shawn,

    I’ve not tested this, but I think I would just add a second copy with the other ad in it but change the PHP count to be 1 or 2 or whatever.

    So, add another one that starts with:
    <?php if ($count == 2) : ?>

    John

  3. ahh ok, thanks john

    i usually have adsense ad on my content area, and if i have about 10 post on main page, with 3 max adsense banner, there will be a blank gap on 4th posting … so that’s why i asked

    i use adsense deluxe plugin myself but it does not have option to limit how many banners should appear on front page and such

    still a good tip

  4. Well, actually, the count ==0 just basically tells the system to place the ad after the first post on the homepage, and before the second one (that is, before the count increments to #1). If you change it to 2, it will put it before the third one, but there will still be only one ad on the page.

    So, basically you just need to put the ad code into your theme manually in two other places. If you can hold off on doing it for just a short while, I’m going to work with Donncha to author a comprehensive post regarding who, how, what, when, and why to monetize your blog. I’d guess it will be 1 to 2 weeks max and we’ll tell you what plugins to use, where to put the code, etc.

    John

  5. questions: adsense only allow 3 banners, so what if i want to have 3 adsense ads instead of one john?

    i increase the “$count == 2”

  6. Here you go, this should work:

    if ($count == 0) :
    if( is_searchengine_user() ) {
    // big nasty advert
    } elseif( is_regular_user() == false ) {
    // smaller less nasty advert
    }
    endif; $count++;

  7. Ok. So I was going to add the code to my example from this post, but I just realized that I don’t know how!

    I don’t think it’s actually possible to nest PHP commands, so could you give me an example of how to add your suggested code here to my code above in the post?

    Thanks once again!

    John

  8. Adding this plugin is very much on my to-do list. I think it’s critical to ‘thank’ readers by displaying ads very selectively and, if possible, not at all to loyal readers.

  9. What I usually do is something like
    1. Check if the user came from a search engine
    2. If not, then check if they’re not a regular user
    3. err, no number 3.

    So:
    if( is_searchengine_user() ) {
    // big nasty advert
    } elseif( is_regular_user() == false ) {
    // smaller less nasty advert
    }

    If you do the search engine check you don’t need to check for the age of the post. That’s included in the first check :)

  10. Yes, it helps a little… Here’s a question:

    if( is_regular_user() == false ) {
    // adsense code
    }

    if( is_old_post() ) {
    // adsense code
    }

    if( is_searchengine_user() ) {
    // adsense code
    }

    Now does this mean:
    A.) IF it is NOT a regular reader, AND IF it is an old post, AND IF it is from a search engine = show ad
    B.) IF it is NOT a regular reader, OR IF it is an old post, OR IF it is from a search engine = show ad
    C.) Something entirely different! ;-)

    By the way… I was reading through the comments on your post (I wish they were threaded :-)) and came across Ozh’s comment about giving his a try because of the UI. I must say, he’s done a fantastic job with the way that works, and it takes the confusion out of setting up the conditions.

    The problem with his plugin is that it doesn’t work with WP-Cache, which of course like 99% of the bloggers I know use! However since you have solved that problem, perhaps you guys should merge your two plugins and make it the Donncha / Ozh Everything + The Kitchen Sink Advertising Plugin!

    Seriously, if we could combine your functionality with his interface then no one would have any need for another advertising plugin and I could stop hacking the crap out of everything!

    John

  11. I really should write another blog post with examples I suppose.
    Try this:
    if( is_regular_user() == false ) {
    // adsense code
    }

    if( is_searchengine_user() ) {
    // show big ugly ads
    }

    Does that help?

  12. Thanks for the tip John! It’s always tough balancing placement with general use. Don’t want to slap the readers around with the ads, but you also want to give them some exposure. It’s always nice not having to pay too much out of pocket to run a site :)

  13. Damn! I do need to install it! Er, actually just turn it on. :-) You know, I have it partially installed, but I had a question to ask you that got me stuck and I didn’t finish it yet!

    For anyone who doesn’t know what we’re talking about here… I bugged Donncha for months to build this plugin which he released about 2-3 weeks ago… and I haven’t yet installed it! :-( The plugin allows you to set things up so that you never show ads to your regular visitors! Yeah! Try it here.

    So, I’ve got the plugin installed, my WP-Config and WP-Cache modified and now I just need to add the code around my ads… but I’m confused by the APIs. (Remember I’m a hack at PHP) So, if I use is-regular-user() do I have to put something after it like == true? Or is that the default state? Also, how do I string them all together?

    I guess just a few more usage examples would help quite a bit.

    John

  14. That’s a nice way to do it. The question is: is that an optimal place for an ad. It might be, maybe someone can share some data on that approach.

Comments are closed.