How To Display Ads Only To Search Visitors

| Created: September 19th, 2008
Adsense Smart Pricing 96 Comments

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):

[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;
}
[/php]

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:

[php]if (function_exists(‘scratch99_fromasearchengine’)) {
if (scratch99_fromasearchengine()) {
INSERT YOUR CODE HERE
}
}[/php]

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:

[php]$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;
}
[/php]

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):

[php]function shylock_adsense_filter($content){
global $id,$user_level;
$output = $content;[/php]

and replace it with:

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

if (function_exists(‘fromasearchengine’)) {
if (fromasearchengine()) {
[/php]

Then go down to about line 364 and look for:

[php] return $output;[/php]

and replace it with:

[php]} } return $output;[/php]

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:

[php]<?php if (function_exists(‘fromasearchengine’)) {
if (fromasearchengine()) { ?>
INSERT YOUR CODE HERE
<?php } } ?>[/php]

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.

96 responses on “How To Display Ads Only To Search Visitors

  1. Chelle@Lose Weight for Free

    Great tutorial! I’ve been meaning to do this for a few of my blogs, maybe today I will actually get around to it! I get plenty of page views and clicks across them all, but I rarely get paid the full amount. I have even experimented taking them completely off some sites but it didn’t seem to really have any impact!

  2. Olivier @ brainwave meditation

    Great tutorial. I will also give a better statistics on your click through rate, as one indeed want to remove everything that came from social sites to have a good idea on this metric.

  3. Jon@Beauty Salon Marketing

    Wow, great tutorial Stephen, thanks for that. I like your last comment about using the technique to serve different content to search engine visitors – have to get my thinking cap on!

    Cheers, Jon

  4. James@BarkTop DVDs and Knives

    Thank you for the excellent information. Smart Pricing is not good so thank you for the tutorial to avoid this penalty.

  5. Blank T-Shirts

    Wow it just amazes me how precise and competitive this internet retail game has gotten. My prediction is that one day at universities they will be offering e-business as a major right along with normal business. E retail is growing despite the economies everywhere going to hell, in the USA the worst since the great depression) This is the new arena. It’s gotten to the point where yea anyone can throw up a website, but you have to know what you are doing to make some money.

    -thanks for the education Stephen

    LINK REMOVED: because of failure to use KeywordLuv syntax (name@keywords)

    1. rob@brighton art

      yes, but dont you get the feeling its just internet people making money off other internet people. isnt that unsutainable? i mean, nobody is actually making/manufaturing anything. it is all built on air. i notice the date on this comment and wonder as the economy slides and slides who is going to be correct in the end.

  6. olly@cheap computers

    This is pretty helpful stuff – have you noticed much of an increase since using these techniques?

    I have been trying to work on removing all ads with a low CTR recently as I have noticed that my earnings have been down a lot – possibly to do with being smartpriced.

  7. Srednarb Promotional

    hi stephen, i’m just wondering if Google is allowing this method? Is this does not violate their TOS or rules? just asking bcoz I am just curious on the hacks and tweaks to make ur earnings boost w/o the “smart pricing”.

    LINK REMOVED: because of failure to use KeywordLuv syntax (name@keywords)

  8. Jerry@Warsaw Indiana Realty

    hahahaha! thanks a lot for the trick that you shared. I will surely try that.

  9. Walter@Best Debt Consolidation

    I love the idea of this plugin, but to be honest, all this hacking code makes me nervous. I’m usually ok with hacks, but I don’t understand this type of code and therefore feel a bit hesitant to try.

    Do you really think it is essential in order not to get smart priced? I would have thought that it is more to do with the actual keywords too? I could be wrong though and am happy to learn something new.
    Thanks

  10. Hailee

    Thank you for the excellent information. Smart Pricing is not good so thank you for the tutorial to avoid this penalty.

  11. Itsme@Greenville IT support

    When googlebot visits your site, I would assume they get the page intended for people who navigate to your site. When people come to your site via google they could get something different. Has Matt Cutts or anyone at google ever commented on the process of doing this?

    I understand why you do it, and the purpose seems legit, but technically you are showing different content to google visitors than you are to visitors who come directly to your site. I wonder if google could consider this to be a form of cloaking. It’s just in this case that as far as the search function of google, your intentions are “honorable.”

  12. Gert Hough@Adsense Content

    Don’t me. I’m just waiting to be informed about an update on these comments. I would love to listen in to your reply regarding the attitude google may have towards this technique.

    My opinion? I say they do not mind as it is not content but ads. But yes, I am looking forward to hearing more. If this is a good thing in all, why not get us a working adsense sharing plugin for wordpress that incorporate the ability to hide google ads sometimes?

    1. Stephen Cronin Post author

      Hi Gert,

      I don’t think Google has ever specifically commented on this approach, but in general, they’re fine with you serving up different content to different visitors, as long as you treat the googlebot the same as everyone else.

      For example, Google has specifically commented on detecting whether a visitor has arrived at your site from a particular geo location and serving them different content based on that. They’re happy with that approach, as long as googlebot gets whatever the normal visitor gets. If googlebot says it’s from Germany it should see whatever a real user from Germany would see.

      This is very similar. If Googlebot comes directly to my site, they won’t see ads (same as my normal visitors). If it comes from a search engine link (unlikely I know), then it gets the ads (same as my normal visitors).

      As for the plugin, maybe one day, but it’s a big job and I have too much on right now. RT from Untwisted Vortex has put out a call for An Extreme AdSense Optimization Plugin for WordPress, but I don’t think anyone’s taken him on it yet.

  13. Zath@Technology Blog

    I’ve only just seen this post, good to see that I wasn’t alone in my thinking about the ad being on the first page only – I ultimately stopped using the original solution as you like found from your analysis, my search engine visitors typically view around 1.5 pages on average.

    I think I’ll give this a try and see how it works as I’m sure social bookmarking traffic such as StumbleUpon prefer sites without Adsense on them.

    Thanks for developing this solution, it looks good to me so far! Have you noticed an improvement in using in since you implemented it Stephen?

  14. Zath@Technology Blog

    Hi Stephen,

    I’ve just been testing it out and it seems to work well, one other question, how long is the cookie valid for?

    I’m guessing people will continue seeing the ads on their visits even if they then bookmark and return direct to the site in future until the cookie expires or is deleted?

    Cheers!

  15. Nate@My Mortgage Blog

    This is a good idea for adsense site if you want to keep a high CTR and true view of SE traffic. If you are using WP blogs to build your websites you can also use a plugin to do the same thing. I forget the name but if you search around on Google I’m sure you can find it quickly. Good luck!

  16. kouji@haiku poems examples

    slick. does make a lot of sense. i can imagine that search engine visitors would be in more of a frame of mind to click ads.

  17. Pete@Game Economy

    Whoa…I didn’t know about the Google Smart Pricing. This function above could potentially increase revenues 10 fold. Outstanding work here. Bmarked and stumbled!

  18. Alex@Job Loss

    I’ve tried this before and I really wasn’t pleased with the results. It’s true that search engine visitors are more likely to click your links, but unless you are smart prices, the trade off isn’t great.

    I tested this by showing different ad units (with different channels) to search engine visitors compared to regular visitors, and I still make more from the non-search engine visitors.

  19. Zubair Naeem@Free Chat Rooms

    great post stephen.. but this would not work with most of the sites.. i tried it on many of my sites but there was no diff. in ecpm ultimately.. =S

  20. Zath@Tech News Blog

    Zubair – I think the last I tried this, that was pretty much my experience, however in terms of the experience for your regular readers, it’s still a good path to take, especially if your ad earning remain fairly constant or even goes up because of it.

  21. Rhys@BizBlog - Monetize Your Site

    Hi Stephen –

    The question, “does hiding the ads to non-searchers work,” is dependent on the type of visitor. Obviously if most of your traffic is ‘Sunday drivers’ from Stumbleupon, then it will usually offer a big potential gain, but if the bulk of your visitors are ‘genuine seekers of truth’ then it could well be counterproductive.

    I have just worked up a little script to do this without plugins (for the benefit of the non WPress world), and I believe my return percentage has gained already.

  22. Rachel@IT outsourcing

    Hi, I’m not sure it’s working properly. I tried entering this page directly, and then finding it in google and coming through google’s search results and I saw the same page. Could it be that the server remembers how I got to this page the first time and ignores how I come back in the following few minutes?

  23. Rick @ hypotheque

    WTG! What a brilliant idea. It’s just now that I’m actually enjoying what is being taught in a tutorial.. haha. I’ll definitely try this.

  24. hakem@Home Trend

    wow this is interesting ideas, even we can select visitor, ie visitor from US more convert than outside US 🙂 and of course more big adsense cpc 😉

  25. Tracy - Massage Chair

    This is something I have to admit I had not thought of before. Thank you for not only bringing this to my attention so I can start making more money and showing me how to do it as well.

    LINK REMOVED: because of failure to use KeywordLuv syntax (name@keywords)

  26. Bill@Debt consolidation

    Very good tutorial. I am going to apply this to my blog immediately and hopefully I will see good results.

  27. bill@money-saving-tips

    Great post. I hadn’t considered “smart pricing” before. Too trusting I suppose 🙂

    I probably won’t make use of this technique for adsense, but it could be cool to customize content based on the search string that the web visitor followed to land on a site. Could dynamically move the relevant content closer to the top of the page based on their search for example.

  28. chris

    It would be great to have a way to show something only the first time like your original function and show other content later.

    I was wanting to show a newsletter signup on the first page view, but it looks like that only works with the old function.

  29. John@Japanese Weekend Maternity

    That is a great tutorial on how to properly benefit from using adsense. I hope to apply what i’ve learned and start earning more.

  30. Prue

    It’s a brilliant idea. I really enjoy reading this. This is a good tutorial. I’ll definitely try this.

  31. Ray Johnson@Make Money On The Internet

    Great advice. Am definitely going to give this a try. Never thought about smart pricing before, but now i realize what i may have been missing out on.

  32. Sorin@point47

    Hello!
    I found your script and put it on my site to test it. I worked but not quite 😛
    I found that I needed to refresh the page to activate the cookie after I enter the page from a search result and this is not that good 😛
    So i replaced cookie with $ _SESSION variable and it works very very good 😛
    Thank you for the ideea!

    1. Stephen Cronin Post author

      Hi Sorin,

      If you follow the code in the New From Search Function section above, then you shouldn’t have a problem. Quote from original post above:

      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).

      Sounds like you must have missed something – but the $_SESSION variable solution should be fine as well. 🙂

  33. Nick@Recruitment Business Start Up

    great post, thanks a lot for this. I’m a bit worried about my adsense account as it does seem to have dropped down a bit per click, but by nothing like the 10% you mentioned (is it that much!?!!!) but something like this that will help make sure it is targetted to the right people is a god send, and as you say should help with the CTR no end.

    Going to have a play around with this over the weekend, thanks again!

  34. tony@Best cheap web hosting.

    Stephen that is a great idea but i wonder if you should make it so it does not show ads when people come from image search also. I know you can get alot of traffic from images but that traffic converts as bad as social bookmark sites.

    I think if you tried not showing ads on any image search your earnings would go up. I bet a article on the difference would be great link bait.

  35. K@magicjack review

    Stephen, this post has been featured in a post in Smashing Magazine. You should see a nice boost in traffic and some well deserved attention from the WordPress community! Just wanted to give you a heads up. 🙂

  36. raj@gadgets blog

    Thanks for the code. I have implemented this on my blog and will observe for any boost in my revenue. If this tip does help boost revenue, I will let you know. So far, my understanding is that it will for sure help me increase my adsense revenue. Let’s see!
    Thanks again!

  37. Pedro Magalhães

    I get and error when i put the google adsense code inside the :

    if (function_exists(‘scratch99_fromasearchengine’)) {
    if (scratch99_fromasearchengine()) {
    INSERT YOUR CODE HERE
    }
    }

    Can anyone type here an example of the google adsense code inside the if??

    Cheers!

  38. Vygantas@Web Browser News

    I followed smashingmagazine quoted things and got:

    Parse error: syntax error, unexpected ‘}’ in /home/favbrows/public_html/wp-content/themes/…/header.php on line 23

    Line 23: }

  39. Nick@simplistic life

    Great article. I am getting some kind of error when entering the first part of the code in the functions php. Any idea?

  40. Jim @ real estate software

    Awesome tips! I have been interested in setting something like this up lately, I know that smart pricing can be a huge problem. I have read many horror stories about this happening.

    I will set this up and see how it does, thanks!

  41. raj@gadgets blog

    Here’s what I found so far using this technique. Since Jan 8th till Jan 20th, the CTR came down and also the revenue. I followed the ads shown on my website and found that they were not relevant for some reason. I removed the code, i.e., allowed the ads to be shown to everyone and to my surprise, both CTR and revenue have gone up. I will put the code back after one week to see what happens.

    If your site is has been placed under smart pricing, if you feel so, do the following.
    1. stop showing adsense ads on your site for at least one week.
    2. include more keywords in the first para of the site.
    3. after one week, show ads on only those top 5-10 pages that have highest traffic
    4. after one more week, start showing ads on other pages where you have placed more keywords as per step 2.

    I followed the above steps on my blog, so I know it works. If you still can’t get things in order, buzz me for help.

  42. steve

    from my experience – smart pricing is only reflected only from googles adwords conversions pixels and your adsense spam score. They also use AI to related types of traffic,keywords, and conversions to come up with the smart price

  43. Katrina Kaif

    The concept is really good. I am really facing this same problem as my blog is celebrity blog and I am promoting it in social media to get some bucks but as you said it is danger gone to get money.

    and so i have decided to go with this technique along with my other blogs.

    Thanks buddy it is just a great post….

    hope i will get nice money after it.

    Thanks

  44. poer@web hosting coupons

    hi Stephen, thanks for the nice article. at first i got a little confused on how you filtering google and live.com, but it’s clear now, you use “/search?” and “search.” string 😛

    i already try the first version of the code, the one that was discussed on smashing magazine and my ctr indeed increase, but the total income is less then before.

    now i am gonna try your new “from search”, hope the test result will be better.

    thanks again.

  45. laughing moon

    First up – thanks for the article.

    However, has there been any reports of people actually earning *more* by implementing the code? It seems that even though CTR goes up, the tradeoff of showing the ads to less people means that overall less $$$ are earned.

    Also, it doesn’t seem like anyone has actually been smart-priced (which is what the code is trying to avoid).

    Any success stories?

    LINK REMOVED: because of failure to use KeywordLuv syntax (name@keywords)

  46. John@Daypacks

    laughing moon: What do you mean by “it doesn’t seem like anyone has actually been smart-priced”? people are smart priced all the time, sometimes without even knowing it. The problem is that they usually have to completely alter their link structure to get more search traffic. With this code they dont have to think about it.

  47. jhon@Latest Mobile Phones

    great post. this is really true that adsense is applicable for search engine traffic . if i get huge traffic from social bookmark sites then i also think one shoud not use adsense or show adsense for only search engine traffic.

  48. andy@Penny Stocks

    Thanks for the great content as always. It is at least a step in the right direction for me.

    But I actually want to go a step further…I want to ONLY show AdSense to visitors who arrive via certain keywords I define (the ones I have tested to convert well, etc.), and if visitors come from anything other than those list of keywords, or even any of the non-search sources as you have described, it won’t show the adsense ads for them.

    Does that make sense? Is there a way to modify your code above to achieve that? Too bad I only know a little bit of PHP. Any help would be appreciated! Thanks.

  49. Larry@Racing Games

    Great article. Reading your post made me think of something else. The function above can also be implemented for other purposes too! You can use the cookie to track your visitors and use it for anything you want other than filtering the Adsense ads. Thanks for sharing it with us. You just got your self a new regular visitor 🙂

  50. Warren@Stock Picks

    I’ve been very happy with the Shylock Adsense, in fact, I prefer it over the WhyDoWork Adsense Plugin (I can’t remember why, but it is in my default WP skel build). But to my utter surprise, I recently got ranked #1 for one of my tags. And when the user clicks on the link through Google, the ads don’t show on the page. Any idea why? Or should I just add the Google code snippet into the single.php? I think that’s where it should go anyways…

  51. poer@free downloads

    @Warren from stock picks, for adsense in tag pages, i think you need to add the adsense code into your archive.php and not your single.php, cmiiw.

  52. JR @ Free Webmaster Tools

    Thanks for the great hacks, will try them out, I too am an avid Grizz fan. I have a question for you, do you think Google Image traffic still counts as SE traffic? Been getting like 15,000 uniques a month from Image traffic for a brand new site and wondering if that affects smart pricing?

  53. Jim Mathieson@Golf Trolleys

    Interesting reading and tutorial but for fairly advanced website and blog advertisers it will make quite a difference.

  54. jaydee@sussex wedding photographer

    Very clever. So your train of blogging has gone from identifying the Smart Pricing problem, to figuring out how it disproportionately affects blogs, to finding a solution, to implementing a solution, and now tweaking that solution so search visitors are tracked with a cookie all along their visit.

    Can I extend it a little further, perhaps off the tracks a little in terms of ads, but along the same lines of “what you can do with your search visitors”? A recent post doing its rounds in twitter about making your wordpress blog “smart” pointed me to the Referrer Detector and WP Greet Box plugins. These basically display a custom message to users depending on which site they came from – eg, “Welcome Googler/Twitterer/NY Times Reader” + Call to action. It’s not an ad but it is a great way to profile your visitors and encourage them to engage with your site / convert in different ways depending on where they came from. I’ve seen it on a few blogs and it’s really effective IMO.

  55. azwan@melayu boleh

    Hi

    How should I determine whether to use this hack or not. is there a rule i.e. to only use this hack if traffic from search engine is < 40%? or something like that?

  56. rohadi@tukang nggame

    i think smart Pricing is not good so thank you for the tutorial to avoid this penalty. once again your post it so great..:)

  57. Eddie@Self help

    Great job, but I think this technique may cause google to ban you from adsense. As far as I know they have a very serious terms upon implementing anything that relates to showing adsense.

  58. Bailey@debt loans

    Very informative site, and very interesting posts. I have bookmarked your site, and will be back, good work guys.. thanks

  59. aizat@melayu boleh

    hi stephen

    its good to see a website that can only show ads only to organic traffic.

    so anyone like our friend will not see the ads and annoying them

  60. James@Celebrity Blog

    One way of looking at it, I guess 🙂 Seems a bit pessimistic but it’s probably true

  61. Michelle@Aksi Budak Sekolah

    hi stephen

    thanks for the tips…is there any way for blogspot user to use hack like this? Is it possible?

  62. Carl at Seguros

    I never read about this technique before, but I must test it on one of my sites.

  63. Udegbunam Chukwudi

    Is there a way of showing an alternate ad to non search engine visitors cos I’m somewhat of skeptical about leaving so much real estate of my blog, unmonetized. 😉
    Have a nice day.

    1. Stephen Cronin Post author

      Hi Udegbunam Chukwudi,

      It wouldn’t be too hard to do, although I don’t have time to spend on this right now.

      Obviously, you wouldn’t want to do this for a blog which attracts mostly search visitors and targeted traffic in the first place – it’s more for those with lots of social traffic. Maybe you could serve up an affiliate product to the social traffic.

  64. Karl Foxley

    This is a very useful hack. You have made this tutorial really easy to follow and implement.

    Thanks,

    Karl

  65. Ryan Caldwell

    How does this integrate with wp-super-cache. For example, let’s say that visitor A comes to the site through search and wp-super-cache creates a cached version of the page with ads showing. But then visitor B comes as a regular visitor and gets fed teh cached page…. will the cached page have ads on it or not?

    1. Stephen Cronin Post author

      Hi Ryan,

      Unfortunately, it doesn’t integrate with wp-super-cache. Wp-super-cache will create a copy of the page and show it to subsequent visitors. Whatever’s on the page when it create’s the copy is what’s displayed. It doesn’t run the logic in this post.

      You do something similar using JavaScript (see my Show Adsense To Search Visitors Only – On Blogger post). This works (even with wp-super-cache) – but there are some doubts about whether this is against Google’s TOS.

    1. Stephen Cronin Post author

      Hi Eddie,

      Thanks for letting me know – although this article has made it’s way to many blogs, including authorative blogs like Smashing Mag. As long as they’re linking to me as the source, then I guess that’s okay…

  66. Noelle

    Wow, My head is spinning. I am new to internet marketing so this was great information. I must be honest, I can’t say I understand it all (I’m still learning) so I think I’m going to have to check out some of your other blogs. I have not used Ad Sence just yet because I am trying out some other techniques, and I must say I had never heard of smart pricing. Can you tell what a newbie I am 🙂 I don’t even have a blog. I am realizing how much I need to learn! So thank you for the information. I am going to check out some of your other blogs to try to make heads or tails of this stuff.

  67. Cografya

    Thanks for letting me know – although this article has made it’s way to many blogs, including authorative blogs like Smashing Mag.

    1. Stephen Cronin Post author

      Hi Cografya,

      Yes, it seems to have gotten around! Most of them link back here which is good.

  68. Debajyoti Das

    Can I face a penalty if I disable “facebook comments widget” or any widget section of my WP site for search visitors…

    PS: You can add .bing. to your code.

  69. David Z

    Sounds like exactly what I’m looking for actually. I have been trying to figure a way to serve ads to search visitors which are a large part of my traffic without “ruining” (IMO) the site experience for regular visitors or those from other referrals.

    Is there a way to add a shortcode to call this from within the body of a post on wordpress?

  70. Radu

    Hi

    Could you please let me know if this script is usable ‘as is’ for blogger sites ?

    Thank you & best regards
    Radu

  71. abdul aziz

    If i using cloudflare, is it still possible for plugin to know between visitor from SE and not?

    thanks,

  72. ahmad yaser

    hi Stephen Cronin, how can set code for only mobile visitor + search engine? i want show ads only for user come from search engine with phone and block desktop. thanks