Warning: hefty explanations and documentation. On a rush? Give the demo a try. Chances are you'll understand right away what and how. Then download. Then please read here.
Current version: 2.0 for WordPress 2.5+ See below for older versions.
You most certainly have two types of visitors on your blog : some returning readers, and a majority of first time visitors. Returning readers come to your site for its content and for what you write. First time visitors, and mostly search engine visitors, come because they are looking for something particular, look at the page, and leave.
The first obvious thought that comes to mind when you want to monetize your blog is: "I'm going to put ads and banners everywhere". By doing so, you won't add any value or service to regular readers, who are not likely to click on your ads. By doing so, you'll also probably won't do justice to your finely handcrafted pixel polished WordPress theme. By not serving ads to your regular visitors, chances are you'll both lose little money and show your readers you're treating them differently.
Therefore, the second obvious thought about blog monetization is : "I wish I could display a lot of ads to those coming once never returning readers, but not bother my regular fans". Enter Who Sees Ads, the ultimate ad management plugin.
Who Sees Ads ?
So, who sees ads ? Now it's up to you.
Who Sees Ads is an advanced ad management plugin that lets you decide who will see your ads, depending on user defined conditions. The association of an ad and these conditions is called a context: a set of circumstances you define, that will eventually display or not an ad.
For instance, you could consider the following criteria: Is the visitor a regular reader? Does this visitor come from a search engine? Is the visitor currently reading a recent post, or something really old?
Live demo
The plugin is active here, to display an ad on top of the right sidebar. Depending on the context, you could see it or not. Its display rules are:
- display if visitors comes from a search engine
- don't display if the visitor is a regular reader
- always display
The ad behavior is defined by the first rule that is matched. Visit the main page of my blog: as I've defined a "Regular reader" here (someone who has read at least 2 pages over the last 10 days), you're now a regular reader, hence rule #2 apply and you don't see the ad any longer. Now go to Google and click on the first result to come back here: rule #1 now applies, and you'll see the ad.
Define Contexts
Ad code + Display rules = Context
You already probably have the Ad code : it can be plain HTML (a text link, a image banner) or Javascript (your Adsense code). Let's define the display rules.
Who Sees Ads offers a very intuitive and powerful visual interface to create your context and pick display rules, in which you naturally select and order them with your mouse. The interface also offers a convenient way to duplicate, rename and delete your contexts.
Have a look and play a bit with this demo. You'll love it.
Display Rules
By default, you can pick or mix any of the following rules :
- If Visitor comes from a search engine, display / don't display
- If Visitor is a regular reader, display / don't display
- If Post is older than XX days, display / don't display
- If Visitor is logged in, display / don't display
- If Date is between specified date interval, display / don't display
- If Ad has been showed less than XX times, display / don't display
- If This visitor has viewed this ad less than XX times, display / don't display
- If All previous conditions fail, try another context
- If Any condition, display / don't display
The ad behavior will be eventually decided by the first rule which is matched. For instance, if you want to display an ad only for search engine visitors, you'll pick the following :
- If Visitor comes from a search engine, display
- If Any condition, don't display
If no rule is matched, nothing displays, so the second rule in the above example is actually optional.
I made up a list of example display rules, be sure to check them.
Advanced Display Rules
You can use PHP functions and make your own custom advanced display rules. Want to display something on home page only ? if (is_home()) display will be your custom display rule.
You can use PHP built-in, WordPress internal, or your own functions. Your brain is the limit.
Please note: you obviously need to know a bit of PHP in order to use the advanced display rules. By default, they are not enabled. If you want them active, edit the beginning of the script and set $wp_ozh_wsa['iknowphp'] to true. This requires your agreement on being on your own if you break your site or if ads don't show as expected.
There are two advanced custom display rules :
- If ( condition ), display / don't display
- If !( condition ), display / don't display
The if and if not rules are working the same, I just thought it could be more convenient in some cases to use an if not rather than an if, and this way you also have two custom rules for the price of one :)
Again, check the example display rules to get an idea of how powerful it is.
Features
Simple and Effective Ad Management
Even if you're not using Who Sees Ads to fine tune display rules, it will make your life easier. Pasting <?php wp_ozh_wsa('google-336-280') ?> in your PHP templates such as sidebar.php is a lot easier than cut and pasting 10 lines of javascript, especially if you decide later to change the javascript across multiple files.
Use it inline or in PHP templates
Create contexts and display ads either in your PHP files on within your posts and pages :
- <?php wp_ozh_wsa('mybanner') ?> in your PHP files such as sidebar.php
- <!--wsa:mybanner--> within posts and pages
Visual interface
If you haven't tried it already, play with the demo. It's not functional of course, but it will show you own the interface lets you visually create contexts, and easily rename, duplicate and delete ads.
Help Wizard
A togglable introductory help contains a handy wizard that will assist you, creating your two first rules. Click on the image for a screenshot of the Wizardry.
Posting help
Within the Post/Edit interface, you'll find a convenient drop down selection to easily insert context you will have created (if you create just one context, the select is replaced with a button)
Google Adsense and Yahoo Publisher Compliant
Per terms of use, YPN (TOS) and Adsense (TOS) impose a maximum number of ads in a page, as follow (as of writing):
- YPN: 3 ads per page
- Adsense :
- 3 ads
- 2 search boxes
- 3 link units
- 3 referral units
Who Sees Ads fully complies to these restriction, and will display ads of a particular type up to the maximum number allowed.
Google Adsense and Yahoo Publisher Compliant, part 2
Per terms of use, YPN and Adsense don't allow ads on error pages such as 404 pages, and on pages that are not viewable by their system.
Who Sees Ads also complies to this policy, and ads won't be displayed on 404 error pages, and on draft posts a publisher is previewing.
Admin Clicks Safety
Admin Click Safety is an option that will prevent you from accidentally clicking on your own ads (Adsense or Yahoo Publisher), replacing them by a placeholder when viewed by the blog admin.
Regular visitors, of course, will see actual ads if applicable. Days of "oops I clicked it!" are over.
Widget support
Who Sees Ads is now supporting widgetized themes for easier ad management.
Custom Preferences Hacking
Advanced users with some PHP editing knowledge can now define a custom set of preferences or behaviors that will override Who Sees Ads' defaults. The plugin comes with an example my_options_sample.php file. Rename it my_options.php, edit it, and never lose any change you'd make when you upgrade the plugin.
3rd party plugin compatibility: Adsense Deluxe and Adsense Manager
For those who are already using Adsense Deluxe or Adsense Manager to manage your Adsense ads, you can seamlessly make the transition to Who Sees Ads and give it a try without uninstalling them. Instead of pasting the actual Adsense code when you create a context, just enter something like the following examples, depending on what plugin you're using:
- <!--adsense#mybanner-->
- adsensem_ad('mybanner')
- adsense_deluxe_ads('mybanner')
Please note: compatibility with these 2 plugins has been implemented to allow easy testing before adopting. I personally find Who Sees Ads much more powerful and efficient, and don't see the point of using it side by side with another ad management plugin. I will not continue support of these plugins if their code evolves and changes so that it breaks with my plugin.
Rotating Ads
You can define only 1 context and assign it as much ad code as you want. You just need to specify your custom code separator in my_options.php and you're done. Example, defining the string *** CODE *** as a separator:
- <img src="banner1.jpg" alt="Banner 1" />
- *** CODE ***
- <img src="banner2.jpg" alt="Banner 2" />
- *** CODE ***
- <img src="banner3.jpg" alt="Banner 3" />
Completely dynamic
The content managed by Who Sees Ads and whether it should display or not is processed dynamically on every visit for every visitor, to ensure maximum efficiency and make sure each visitor receives the treatment it deserves. The drawback of this aspect is that the plugin is not compatible with cache plugins, which generate each page once and serve the same static file to each subsequent visitors.
Download
ozh-who-sees-ads.zip
Extract and upload to your blog, preserving directory structure if any.
Note: download counter here and stats on wordpress.org may differ and reflect the number of downloads before this plugin was hosted on the plugin directory
PHP Template usage
The regular PHP call you will insert in your PHP templates is the following:
- <?php wp_ozh_wsa('myad'); ?>
However, you can pass an additional parameter to turn off output and have the ad code returned instead:
- <?php $code = wp_ozh_wsa('myad', false); ?>
By default, the plugin returns an HTML comment when no ad has to be displayed, for instance:
- <!-- WSA: rules for context 'myad' did not apply -->
A complete example of how to use WSA with your own functions would be something like:
- <?php
- $code = wp_ozh_wsa('myad', false);
- if (strpos($code,'<!-- WSA') !== false) {
- // plugin returned actual code, do something with it
- ...
- } else {
- // plugin returned no code to be displayed
- }
- ?>
Examples and advanced use
The obvious usage of this plugin is to display ads with rules as :
- Display ad when user comes from a search engine
- Don't display ads to my regular readers
- Display ads on old stuff, don't display on fresh posts
But you can also :
Greet your returning visitors
You can display ads, or really anything. For instance, display something only to your regular readers: a "welcome back" message, or a special offer you don't want them to miss.
Geo target !
In conjunction with my own IP to Nation plugin, you can easily target visitor from a particular country. For instance, you've always wanted to display Yahoo Publisher ads to American visitors only, as Yahoo suggestscompells? Easy, your context simply has to use the following custom if rule:
if (wp_ozh_getCountryName(0) == 'United States'), display
Check the example display rules for more ideas of usage.
Older version
Download: Who Sees Ads 1.3.3 for WordPress 2.3.3-
Question?
If you have a question, read all the comments: the answer *is* there.
Shorter URL
Want to share or tweet this page? Please use this short URL: http://ozh.in/kr
Reward Your Regular Readers – Skip The Ads…
Now I know you've read about this and it's usually a good idea: concentrate most of your ads on your older posts and hide ads from your regular visitors. I mean, they come here everyday, reward them with a little bit of clean c…
The complete list of dosh plugins…
Blogs are the hardest sites to monetize, but yet when it comes to wordpress there is always an automated solution for you In today's post we will write about the top wordpress plugins that you may use in order to earn money from your wordpress b…
Great plugin. Works like a charm. There is just one thing. I was wondering if I could add search engines. Many of my visitors comes from norwegian search engines, and I would like to show them ads as well. But not visitors from ie other blogs. Is this possible?
Nvm, I found the answer in your code. Added a couple norwegian search engines and tested. Works nicely.
I'm sorry if this is an obvious question, but how would i stop adsense ads from being displayed in sponsored posts? I have my adsense code in my template files and not in individual posts.
Ada » add a custom rule with something like if in_category(15) then don't display (for this, you need to edit the plugin and set the magic variable "iknowphp" to true)
Thank you so much for answering. You've made my day. Fantastic plugin. Thanks again.
Hi,
I've installed the plugin (I have wordpress 2.0.4 and the doco says it works from 2.0 onwards), but when I go to the WSA option within the admin menus, it comes back with:
Fatal error: Call to undefined function attribute_escape() in [path]/wp-content/plugins/who_sees_ads/wp_ozh_whoseesads_admin.php on line 566
Does there need to be write permissions somewhere?
Regards,
OG
OG » I'm going to bump the lowest version up then, seems that this particular function was introduced later than I thought of. You're running a pretty old and deprecated version of WP, so I strongly suggest you upgrade at least to 2.0.11. If for some reason you cannot / don't want, add the following somewhere in the plugin :
But, again, I really suggest you upgrade your WP installation which is most probably insecure.
Neat concept. I just installed it on my blog, but I'm not able to drag and drop rules. I'm not sure, if this has anything to do with WordPress or Scriptaculous conflict. I'm running the latest version of WordPress 2.3
Any suggestions?
Thilak » must be javascript, maybe from another plugin
Ozh: Thanks for the quick reply. Should I try deactivating all plugins and then try creating context?
great plugin!
Is there anyway some sort of click fraud protection can be integrated and added to this plugin? i am really looking for a plugin that will help protect me from click fraud. It would be great if a rule could be added such as "if user at this IP has click 5 ads – do not display". Somthing like that would be great. Any thoughts?
can you give me an exact example of using $_SERVER['HTTP_REFERER'] as an advanced rule? I am trying to display ad code ONLY if it comes from a certain referer. And also this would make a great rule as well to add.
Joe » click fraud is a much wider topic than simply checking IP, and involves inaccurate client-side scripting, which is not the purpose of this plugin.
John » such a rule would be something like :
Ads on WordPress.com…
On the support forums, Matt gave an insight into how ads are served at WordPress.com. The same approach is used in the Who Sees Ads plugin for WordPress Classic.
I'm glad to know about the plugin, which seems rather neat. But I'm still not …
I have edited your list of searchengines a bit. I found that you have listed 'google.' as a searchengine. The only problem is that google also have a lot of other services, like Google Reader wich also comes from google.com. To correct this, I replaced 'google.' with and '/search?' for regular serching (all languages) and 'images.google.' for image search. Works great. I have also added other searchengines.
I was wondering if you could put the list in a wordpress option? That way I won't lose my list every time I update this great plugin. What do you think?
Thanks for your code on the http_referer.. it worked great!!
Next question: is there a way to call another plugin by putting in the CODE box?
Ex. IF visitor is from search engine, then run the wordpress random image plugin
john » if you need to use internal functions, look at the source of the plugin, it's pretty well commented and most functions are self explanatory (for instance there's a function wp_ozh_wsa_is_fromsearchengine()).
XmasB » making search engines an editable option is something that's too easy to do to be missed, I'll implement that on next upgrade. Plus, your remark about 'google' vs '/search' is wise, I'll add this soon. Thanks for feedback :)
Np, Ozh. Thank you for a great and useful plugin. One of the best I know.
Hi Ozh,
What a great plugin!
I haven't read all of the comments here, so I don't know whether or not you've already done this. But since it wasn't included in the current version of your Who Sees Ads plugin, I went ahead and made two modifications…
1. I added this condition:
The visitor's views are tracked by cookies.
2. I created a Who Sees Ads widget.
You can get my modified versions here:
http://ezexpertwebtools.com/website-tools/2007/10/06/ez-expert-who-sees-ads/
and I would love for you to include these modifications in your own plugin, since I really just did it for myself and I don't plan on making any further changes.
Let me know what you think if you have the time. :)
Paula.
Ozh,
Thanks again for your great plugin. I just upgraded to WP 2.3, and now I can't access your options page. I'm running WSA 1.2.1. When I go to the options page, I get a box with this message:
Any help is appreciated!
Andrew
I'm getting the same thing that Andrew Flusche is getting above me. I can no longer get to the admin panel. I was running 1.0 and upgraded to 1.2.1 in a new folder.
Hi,
first of all: thank you for the great plugin.
Unfortunately I cannot use it because I get two errors:
1. I cannot move the rules with "drag and drop"
2. When I upgrade to WP 2.3 I get the same error as the two commenters above:
I found the two plugins that are causing these errors, deactivating them makes WSA work again:
For 1.
ImageManager 2.4.1 is apparently causing this javascript problem.
For 2.
WP-ContactForm 1.5-alpha is causing this error for me.
The problem is, both interfering plugins are vital for my blog. I cannot abandon them :( .
Is there any chance to fix this?
Thank you.
Thank you very much for this plugin, wonderful work.
I was wondering if I could add html code before and after the Adsense code? I tried adding a <div style="float:left; …> etc but it just ignores it.
I would like to float ad boxes in the post nicely, obviously if I add that code into the template files it will reserve a space regardless of the ad being displayed.
I'm using WP2.3 and WSA 1.2.1
Thanks again.
Mahmood » this is not a plugin issue, it's a pure CSS matter. In the plugin you can surround your ad with any HTML & CSS you want. The result will just depend on your theme.
Hi Ozh! Thanks a bunch for releasing 1.2.2! That fixed the admin panel issue I was having. You're the man!!
Hi, Ozh, thanks for very good plugin, but I have such problem:
After plugin activation WP visual editor displays only the code. If I would click on code button nothing would happen. And this is affecting only FireFox, on IE 7 everything is OK. What coul cause this problem? I'm running WP 2.2.3 and latest WSA.
Thanks.
HOLD IT!
The problem appears to be only in the placeholder and not the normal ad display! I've just checked by coming through Google and the ads display with proper wrapping, but if I visit the article/site by logging in as admin (with the placeholder option activated obviously) it ignores the wrapping, which somewhat makes sense actually because I suppose the code just bypasses the ads completely!
Maybe you could put a "wrapping field" on the wishlist in order for people to enter html code before and after the ads?
Mahmood » suggestion received! I'm adding this into WSA 1.3, which will have support for a number of personal options
i have the same problem like Tomas M :(
Cineva & Tomas » this is hopefully fixed in the upcoming 1.3 release
hi ozh.
I am running WP 2.1.3. When I activate your plugin, the formatting bar in my post editor disappears. Did I install incorrectly?
When I deactivate the plugin, my edit bar comes back.
Thanks!
Larry » make your own my_options.php with latest plugin and disable the editor buttons.
Any chance you could add direct support for the WPAds plugin, the same way it exists for AdSense Deluxe? The nice feature about WPAds is its ability to rotate different ads in the same slot. Yes, I could hack it in with PHP, but it would be a lot easier, and more flexible, to do it all in Who Sees Ads.
http://thesandbox.wordpress.com/wpads/
Leszek » why not, it's easy to implement, but if I happen to do this, it will be with no warranty that I'll support future evolutions of this plugin. Keeping track of others' plugins is just too cumbersome.
Understood. Though if you're going to drop support of a plug-in, better AdSense Deluxe than this one :). With Who Sees Ads, ASD is redundant.
After upgrading to version 1.3, the ability to post advertisements using the is flat out broken.
I've tried it on several themes, and it's simply broke.
The editor works at least, but it is useless if it isn't going to allow me to put advertisements in with my content.
Please fix ASAP.
Thanks.
Sorry, my post didn't format correctly above.
I'm running WP 2.3, and just upgraded to v1.3 of Who Sees Ads
The above code will work fine on a sidebar.
This code does not work period, no matter where I try placing it.
Something must be broken in the code because the previous version worked fine for me, except the fact that it would render the WYSIWYG editor unuseable. Now the WYSIWYG editor works fine, and the ability to post advertisements within a post is broken.
So yeah, hopefully this will be fixed very soon.
Hello, after activating version 1.3.2, going to the who sees ads option page, o nthe bottom of the page I get the following error:
Fatal error: Call to undefined function: wp_dropdown_users() in /var/www/web40/web/wp-content/plugins/ozh-who-sees-ads/wp_ozh_whoseesads_admin.php on line 727
can you help me solve this, please?
ovidiu » you probably incorrectly overwrote the old file, or downloaded it in the middle of my upgrade. The function wp_dropdown_users() is defined in the plugin for those running deprecated installs of WordPress. Please re-download the plugin and upload it to your server again.
ok, deleted my version, redownloaded, activated, all is well now, but the plugin still displays version 1.3.2 – seems you forgot to change the version number.
Hey Ozh, i first activated plugin and everything was working fine, so i went to optiosn to start creating a new context.
After creating it i couldn\'t delete it and now everytime i run WSA 1.3.3 i get
Even if i disable contactform plugin i get the 453 line error.
Anything? thanks!
I have created the second context from the examples on the options page, read through its settings, then deleted it. After deletion I got this error:
Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/web40/web/wp-content/plugins/ozh-who-sees-ads/wp_ozh_whoseesads_admin.php on line 1386
Warning: Invalid argument supplied for foreach() in /var/www/web40/web/wp-content/plugins/ozh-who-sees-ads/wp_ozh_whoseesads_admin.php on line 1386
Selection deleted
any more ideas? after reloading the page, everything seems fine.
Pablo » I cannot reproduce this error and this has not been reported by anyone else so I don't know what could cause it. This is mostly induced either by something you did wrong or by a conflict with your contact form plugin.
ovidiu » I cannot reproduce this error which is related to your theme & its widgets. I even installed your theme on my test blog and still cannot find anything broken. Unless you're using them, you might disable the support for widgets (using the my_options.php preference file, please read the doc here)
actually I use the disable_widgets plugin, because I use the sidebar modules plugin….
But I guess I will make soem further tests, if everything is working fine, I can live with some errors when deleting contexts..
Thank you for the new version.
I unfortunately still have some issues with the plugin "ImageManager". It won't work together with WSA.
I can call it in the editor, but not insert an image with it.
Also when ImageManager is active I cannot make any adjustments in WSA.
Is it a WSA problem or a ImageManager problem?