Do you want to learn how to show ads just to visitors that came from a search engine ?
According to our study and that of many industry experts, search engine visitors are more inclined than regular readers to click on targeted adverts. In this article, we’ll show you how to make more money from your site by just showing advertising to search engine visitors. Your regular visitors, on the other hand, are not exposed to these advertisements. This is especially effective when using tailored Pay-Per-Click (PPC) ad units like Google Adsense.
We understand that some of you are code nerds who refuse to use the widget settings. Lester’s site offers a very informative Usage Tab that shows how to integrate the most rated, highest rated, and other metrics right into your WordPress themes. The WP-PostRatings Usage Guide may be found here.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
$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, "/" , ".wpbeginner.com" ); $sevisitor =true; } } function wpbeginner_from_searchengine(){ global $sevisitor ; if ( $sevisitor ==true || $_COOKIE [ "sevisitor" ]==1) { return true; } return false; } |
You must first choose which rating image you wish to use for your posts on the plugin’s settings page. Bars, hearts, numbers, plus-minus, the classic stars, thumbs up/down, up-down arrows, and other options are included in the plugin.
After you’ve decided on a rating system, go ahead and click “Max Ratings.” The plugin will choose an acceptable value for you, but if you’re using the bars picture, you might wish to provide your own rating value. Going over 5 stars and numbers seems futile because there are only 5 stars.
1
2
3
4
|
<?php if (function_exists( 'wpbeginner_from_searchengine' )) { if (wpbeginner_from_searchengine()) { ?> INSERT YOUR CODE HERE <?php } } ?> |
The code above determines whether the Referrer agent is from a Google, Yahoo, Delicious, or other sort of search URL. If a visitor’s browser reports that the Referrer Agent came from one of the search sites we’ve listed, their browser will keep a cookie called’sevisitor’ for one hour from the time they visited your site. The majority of search visitors do not go through to the second page, but if your site is geared to maximize pageviews or offers intriguing content, they will.
In such situation, WordPress will show these users the Search Engine Specific Ad that you have set for one hour from the moment they first visited your site. If a user saves your site and returns the next day because they enjoy it, they will be deemed a regular reader and will not see the Search Engine-specific information.
We hope you’ll take use of this code to boost your ad earnings. If you enjoyed this article, please share it with your friends.