{"id":639,"date":"2007-06-28T22:04:37","date_gmt":"2007-06-28T20:04:37","guid":{"rendered":"http:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-who-sees-ads-control-adsense-display\/"},"modified":"2010-10-26T20:49:28","modified_gmt":"2010-10-26T18:49:28","slug":"wordpress-plugin-who-sees-ads-control-adsense-display","status":"publish","type":"page","link":"https:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-who-sees-ads-control-adsense-display\/","title":{"rendered":"Who Sees Ads ? Manage your Ads, Control Who Sees Them"},"content":{"rendered":"<p><strong>Warning: hefty explanations and documentation. On a rush? Give the <a href=\"http:\/\/planetozh.com\/download\/plugins\/who-sees-ads-demo\/\" class=\"nopaypal\">demo<\/a> a try. Chances are you&#39;ll understand right away what and how. Then <a href=\"#download\">download<\/a>. Then please read here.<\/strong><\/p>\n<p><strong>Current version: 2.0 for WordPress 2.5+<\/strong> See below for older versions.<\/p>\n<p>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.<\/p>\n<p>The first obvious thought that comes to mind when you want to monetize your blog is: &quot;<em>I&#39;m going to put ads and banners everywhere<\/em>&quot;. By doing so, you won&#39;t add any value or service to regular readers, who are not likely to click on your ads. By doing so, you&#39;ll also probably won&#39;t do justice to your finely handcrafted pixel polished WordPress theme. By not serving ads to your regular visitors, chances are you&#39;ll both lose little money and show your readers you&#39;re treating them differently.<\/p>\n<p>Therefore, the second obvious thought about blog monetization is : &quot;<em>I wish I could display a lot of ads to those coming once never returning readers, but not bother my regular fans<\/em>&quot;. Enter <strong>Who Sees Ads<\/strong>, the <strong>ultimate ad management plugin<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/wp-content\/uploads\/2008\/04\/who-sees-ads-wp25.gif\" alt=\"Who Sees Ads : the Ultimate Ad Management Plugin\" class=\"imgcenter\" \/><\/p>\n<h2>Who Sees Ads ?<\/h2>\n<p>So, who sees ads ? Now it&#39;s up to you.<\/p>\n<p><strong>Who Sees Ads<\/strong> is an advanced <strong>ad management<\/strong> plugin that lets you decide who will see your ads, depending on <strong>user defined conditions<\/strong>. The association of an ad and these conditions is called a <strong>context<\/strong>: a set of circumstances you define, that will eventually display or not an ad.<\/p>\n<p>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?<\/p>\n<h2>Live demo<\/h2>\n<p>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:<\/p>\n<ol>\n<li>display if visitors comes from a search engine<\/li>\n<li>don&#39;t display if the visitor is a regular reader<\/li>\n<li>always display<\/li>\n<\/ol>\n<p>The ad behavior is defined by the first rule that is matched. Visit the <a href=\"\/blog\/\">main page<\/a> of my blog: as I&#39;ve defined a &quot;Regular reader&quot; here (someone who has read at least 2 pages over the last 10 days), you&#39;re now a regular reader, hence rule #2 apply and you don&#39;t see the ad any longer. Now go to <a href=\"http:\/\/www.google.com\/search?q=planetozh+who+sees+ads\">Google<\/a> and click on the first result to come back here: rule #1 now applies, and you&#39;ll see the ad.<\/p>\n<h2>Define Contexts<\/h2>\n<p><strong>Ad code + Display rules = Context<\/strong><\/p>\n<p>You already probably have the Ad code : it can be plain HTML (a text link, a image banner) or Javascript (your Adsense code). Let&#39;s define the display rules.<\/p>\n<p><strong>Who Sees Ads<\/strong> 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.<\/p>\n<p>Have a look and play a bit with this <a href=\"http:\/\/planetozh.com\/download\/plugins\/who-sees-ads-demo\/\" class=\"nopaypal\">demo<\/a>. You&#39;ll love it.<\/p>\n<h2>Display Rules<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/rules.gif\" class=\"imgcenter\" alt=\"Possible rules\"\/><\/p>\n<p>By default, you can pick or mix any of the following rules :<\/p>\n<ul>\n<li>If <strong>Visitor comes from a search engine<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>Visitor is a regular reader<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>Post is older than XX days<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>Visitor is logged in<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>Date is between specified date interval<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>Ad has been showed less than XX times<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>This visitor has viewed this ad less than XX times<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>All previous conditions fail, try another context<\/strong><\/li>\n<li>If <strong>Any condition<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<\/ul>\n<p>The ad behavior will be eventually decided by the <strong>first rule which is matched<\/strong>. For instance, if you want to display an ad only for search engine visitors, you&#39;ll pick the following :<\/p>\n<ol>\n<li>If <strong>Visitor comes from a search engine<\/strong>, <strong>display<\/strong><\/li>\n<li>If <strong>Any condition<\/strong>, <strong>don&#39;t display<\/strong><\/li>\n<\/ol>\n<p>If no rule is matched, nothing displays, so the second rule in the above example is actually optional.<\/p>\n<p>I made up a list of <a href=\"https:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-who-sees-ads-control-adsense-display\/who-sees-ads-example-display-rules\/\">example display rules<\/a>, be sure to check them.<\/p>\n<h2>Advanced Display Rules<\/h2>\n<p><a href=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/iknowphp.gif\" rel=\"lightbox\"><img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/iknowphp-s.gif\" alt=\"Advanced custom PHP rules\" class=\"imgleft\"\/><\/a> You can use PHP functions and make your own custom advanced display rules. Want to display something on home page only ? <tt>if (is_home()) display<\/tt> will be your custom display rule.<\/p>\n<p>You can use PHP built-in, WordPress internal, or your own functions. Your brain is the limit.<\/p>\n<p><strong>Please note<\/strong>: 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 <strong>$wp_ozh_wsa[&#39;iknowphp&#39;]<\/strong> to <strong>true<\/strong>. This requires your agreement on being on your own if you break your site or if ads don&#39;t show as expected.<\/p>\n<p>There are two advanced custom display rules :<\/p>\n<ul>\n<li>If <strong>( <em>condition<\/em> )<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<li>If <strong>!( <em>condition<\/em> )<\/strong>, <em>display \/ don&#39;t display<\/em><\/li>\n<\/ul>\n<p>The <strong>if<\/strong> and <strong>if not<\/strong> rules are working the same, I just thought it could be more convenient in some cases to use an <em>if not<\/em> rather than an <em>if<\/em>, and this way you also have two custom rules for the price of one :)<\/p>\n<p>Again, check the <a href=\"https:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-who-sees-ads-control-adsense-display\/who-sees-ads-example-display-rules\/\">example display rules<\/a> to get an idea of how powerful it is.<\/p>\n<h2>Features<\/h2>\n<h3>Simple and Effective Ad Management<\/h3>\n<p>Even if you&#39;re not using <strong>Who Sees Ads<\/strong> to fine tune display rules, it will make your life easier. Pasting <em>&lt;?php wp_ozh_wsa(&#39;google-336-280&#39;) ?><\/em> in your PHP templates such as <em>sidebar.php<\/em> is a lot easier than cut and pasting 10 lines of javascript, especially if you decide later to change the javascript across multiple files.<\/p>\n<h3>Use it inline or in PHP templates<\/h3>\n<p>Create contexts and display ads either in your PHP files on within your posts and pages :<\/p>\n<ul>\n<li>&lt;?php wp_ozh_wsa(&#39;mybanner&#39;) ?> in your PHP files such as sidebar.php<\/li>\n<li>&lt;!-<em><\/em>-wsa:mybanner-<em><\/em>-> within posts and pages<\/li>\n<\/ul>\n<h3>Visual interface<\/h3>\n<p>If you haven&#39;t tried it already, play with the <a href=\"http:\/\/planetozh.com\/download\/plugins\/who-sees-ads-demo\/\" class=\"nopaypal\">demo<\/a>. It&#39;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.<\/p>\n<h3>Help Wizard<\/h3>\n<p>A togglable introductory help contains a handy <strong>wizard<\/strong> that will assist you, creating your two first rules. Click on the image for a screenshot of the Wizardry.<br \/>\n<a href=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/wizard.gif\" rel=\"lightbox\"><img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/wizard-s.gif\" alt=\"Wizard !\" class=\"imgcenter\" \/><\/a> <\/p>\n<h3>Posting help<\/h3>\n<p>Within the Post\/Edit interface, you&#39;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)<br \/>\n<img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/editor-multi.gif\" alt=\"Editor button\" class=\"imgcenter\" \/><\/p>\n<h3>Google Adsense and Yahoo Publisher Compliant<\/h3>\n<p>Per terms of use, YPN (<a href=\"https:\/\/publisher.yahoo.com\/legal\/prog_policy.php\">TOS<\/a>) and Adsense (<a href=\"https:\/\/www.google.com\/adsense\/support\/bin\/answer.py?answer=48182#pla\">TOS<\/a>) impose a maximum number of ads in a page, as follow (as of writing):<\/p>\n<ul>\n<li>YPN: 3 ads per page<\/li>\n<li>Adsense :\n<ul>\n<li>3 ads<\/li>\n<li>2 search boxes<\/li>\n<li>3 link units<\/li>\n<li>3 referral units<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Who Sees Ads<\/strong> fully complies to these restriction, and will display ads of a particular type up to the maximum number allowed.<\/p>\n<h3>Google Adsense and Yahoo Publisher Compliant, part 2<\/h3>\n<p>Per terms of use, YPN and Adsense don&#39;t allow ads on error pages such as 404 pages, and on pages that are not viewable by their system.<br \/>\n<strong>Who Sees Ads<\/strong> also complies to this policy, and ads won&#39;t be displayed on 404 error pages, and on draft posts a publisher is previewing.<\/p>\n<h3>Admin Clicks Safety<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/planetozh.com\/blog\/images\/who_sees_ads\/admin-safety.gif\" alt=\"Admin Click Safety\" class=\"imgleft\"\/> <strong>Admin Click Safety<\/strong> 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.<br \/>\nRegular visitors, of course, will see actual ads if applicable. Days of &quot;oops I clicked it!&quot; are over.<\/p>\n<h3>Widget support<\/h3>\n<p>Who Sees Ads is now supporting widgetized themes for easier ad management.<\/p>\n<h3>Custom Preferences Hacking<\/h3>\n<p>Advanced users with some PHP editing knowledge can now define a custom set of preferences or behaviors that will override Who Sees Ads&#39; defaults. The plugin comes with an example <strong>my_options_sample.php<\/strong> file. Rename it <strong>my_options.php<\/strong>, edit it, and never lose any change you&#39;d make when you upgrade the plugin.<\/p>\n<h3>3rd party plugin compatibility: Adsense Deluxe and Adsense Manager<\/h3>\n<p>For those who are already using Adsense Deluxe or Adsense Manager to manage your Adsense ads, you can seamlessly make the transition to <strong>Who Sees Ads<\/strong> 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&#39;re using:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">code<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"code\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;!--adsense#mybanner--&gt;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">adsensem_ad('mybanner')<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">adsense_deluxe_ads('mybanner')<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p><strong>Please note:<\/strong> compatibility with these 2 plugins has been implemented to allow easy testing before adopting. I personally find <strong>Who Sees Ads<\/strong> much more powerful and efficient, and don&#39;t see the point of using it side by side with another ad management plugin. <strong>I will not continue support<\/strong> of these plugins if their code evolves and changes so that it breaks with my plugin.<\/p>\n<h3>Rotating Ads<\/h3>\n<p>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 <em>my_options.php<\/em> and you&#39;re done. Example, defining the string <em>*** CODE ***<\/em> as a separator:<\/p>\n<div id=\"ig-sh-2\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">code<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"code\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;img src=&quot;banner1.jpg&quot; alt=&quot;Banner 1&quot; \/&gt;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">*** CODE ***<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;img src=&quot;banner2.jpg&quot; alt=&quot;Banner 2&quot; \/&gt;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">*** CODE ***<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&lt;img src=&quot;banner3.jpg&quot; alt=&quot;Banner 3&quot; \/&gt;<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<h3>Completely dynamic<\/h3>\n<p>The content managed by <strong>Who Sees Ads<\/strong> 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.<\/p>\n<h2 id=\"download\">Download<\/h2>\n<div class=\"download\">\nDownload the plugin :<br \/>\n<a href=\"http:\/\/downloads.wordpress.org\/plugin\/ozh-who-sees-ads.zip\">ozh-who-sees-ads.zip<\/a><br \/>\nExtract and upload to your blog, preserving directory structure if any.<br \/>\n<small>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<\/small>\n<\/div>\n<h2>PHP Template usage<\/h2>\n<p>The regular PHP call you will insert in your PHP templates is the following:<\/p>\n<div id=\"ig-sh-3\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">php<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"php\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&lt;?php<\/span> wp_ozh_wsa<span style=\"color: #009900\">&#040;<\/span><span style=\"color: #0000ff\">'myad'<\/span><span style=\"color: #009900\">&#041;<\/span><span style=\"color: #339933\">;<\/span> <span style=\"color: #000000;font-weight: bold\">?&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>However, you can pass an additional parameter to turn off output and have the ad code returned instead:<\/p>\n<div id=\"ig-sh-4\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">php<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"php\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&lt;?php<\/span> <span style=\"color: #000088\">$code<\/span> <span style=\"color: #339933\">=<\/span> wp_ozh_wsa<span style=\"color: #009900\">&#040;<\/span><span style=\"color: #0000ff\">'myad'<\/span><span style=\"color: #339933\">,<\/span> <span style=\"color: #009900;font-weight: bold\">false<\/span><span style=\"color: #009900\">&#041;<\/span><span style=\"color: #339933\">;<\/span> <span style=\"color: #000000;font-weight: bold\">?&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>By default, the plugin returns an HTML comment when no ad has to be displayed, for instance:<\/p>\n<div id=\"ig-sh-5\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">HTML<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"html4strict\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #808080;font-style: italic\">&lt;!-- WSA: rules for context 'myad' did not apply --&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<p>A complete example of how to use WSA with your own functions would be something like:<\/p>\n<div id=\"ig-sh-6\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">php<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"php\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">&lt;?php<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000088\">$code<\/span> <span style=\"color: #339933\">=<\/span> wp_ozh_wsa<span style=\"color: #009900\">&#040;<\/span><span style=\"color: #0000ff\">'myad'<\/span><span style=\"color: #339933\">,<\/span> <span style=\"color: #009900;font-weight: bold\">false<\/span><span style=\"color: #009900\">&#041;<\/span><span style=\"color: #339933\">;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #b1b100\">if<\/span> <span style=\"color: #009900\">&#040;<\/span><span style=\"color: #990000\">strpos<\/span><span style=\"color: #009900\">&#040;<\/span><span style=\"color: #000088\">$code<\/span><span style=\"color: #339933\">,<\/span><span style=\"color: #0000ff\">'&lt;!-- WSA'<\/span><span style=\"color: #009900\">&#041;<\/span> <span style=\"color: #339933\">!==<\/span> <span style=\"color: #009900;font-weight: bold\">false<\/span><span style=\"color: #009900\">&#041;<\/span> <span style=\"color: #009900\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #666666;font-style: italic\">\/\/ plugin returned actual code, do something with it<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #339933\">...<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #009900\">&#125;<\/span> <span style=\"color: #b1b100\">else<\/span> <span style=\"color: #009900\">&#123;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp; &nbsp; <span style=\"color: #666666;font-style: italic\">\/\/ plugin returned no code to be displayed<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #009900\">&#125;<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">?&gt;<\/span><\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<h2>Examples and advanced use<\/h2>\n<p>The obvious usage of this plugin is to display ads with rules as :<\/p>\n<ul>\n<li>Display ad when user comes from a search engine<\/li>\n<li>Don&#39;t display ads to my regular readers<\/li>\n<li>Display ads on old stuff, don&#39;t display on fresh posts<\/li>\n<\/ul>\n<p>But you can also :<\/p>\n<h3>Greet your returning visitors<\/h3>\n<p>You can display ads, or really anything. For instance, display something <em>only<\/em> to your regular readers: a &quot;welcome back&quot; message, or a special offer you don&#39;t want them to miss.<\/p>\n<h3>Geo target !<\/h3>\n<p>In conjunction with my own <a href=\"https:\/\/planetozh.com\/blog\/2004\/08\/ip-to-nation-plugin\/\">IP to Nation<\/a> plugin, you can easily target visitor from a particular country. For instance, you&#39;ve always wanted to display Yahoo Publisher ads to American visitors only, as Yahoo <strike>suggests<\/strike>compells? Easy, your context simply has to use the following custom <strong>if<\/strong> rule:<br \/>\n<strong>if (wp_ozh_getCountryName(0) =<em><\/em>= &#39;United States&#39;), display<\/strong><\/p>\n<p>Check the <a href=\"https:\/\/planetozh.com\/blog\/my-projects\/wordpress-plugin-who-sees-ads-control-adsense-display\/who-sees-ads-example-display-rules\/\">example display rules<\/a> for more ideas of usage.<\/p>\n<h2>Older version<\/h2>\n<div class=\"download\">Who Sees Ads is still available (yet not maintained any more) for WordPress 2.3.3 and earlier. Note that I strongly recommend always running the latest version of WordPress.<br \/>\nDownload: <a href=\"http:\/\/downloads.wordpress.org\/plugin\/ozh-who-sees-ads.1.3.3.zip\">Who Sees Ads 1.3.3<\/a> for WordPress 2.3.3-\n<\/div>\n<h2>Question?<\/h2>\n<p>If you have a question, read all the comments: the answer *is* there.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: hefty explanations and documentation. On a rush? Give the demo a try. Chances are you&#39;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\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":241,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-639","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=639"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/639\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/pages\/241"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}