Nov 7, 2009

Wordpress: Google Adsense Referral Rotator Plug-in

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Software > Content Management Systems (CMS) & Blogs > WordPress

Wordpress: Google Adsense Referral Rotator Plug-in

miCRoSCoPiC^eaRthLinG
Preamble:

Google AdSense Referrals are pretty cool in a way as they contribute well in topping up on your daily AdSense earnings. Moreover, they're quite unobtrusive and can be placed anywhere on the page without interfering with the content much. According to me they're best placed in the side-bar and since I'm using a widget enabled theme I got down to searching for a widget plug-in that would let me to do just that.

If you don't know how a AdSense Referral looks like, here's a snapshot…

IPB Image

Anyway, I found plenty of AdSense widget plug-ins that allow you to display the text-ads anywhere on the side-bars. None of the plug-ins I found were cut-out for Referral Ads only, but with some minor modifications one could use the available ones to show referrals too.

Google provides you with 4 different kinds of referrals at the moment and my idea was to keep rotating between all of them randomly, thus presenting your visitors with a wider range of choice to pick from. Unfortunately, I couldn't find a single one in this category and hence with whatever limited knowledge of WordPress I have, I got down to writing one of my own. The idea was to use the mt_rand function of PHP which …

"uses a random number generator with known characteristics using the Mersenne Twister, which will produce random numbers four times faster than what the average libc rand()." provides.

… and generate a number between 1 & 4 and use that number as a key to an array holding the google_cpa_choice code for the four different referrals. Pretty easy, eh ? Every time a visitor loads the page containing this widget in the sidebar, a new random number is generated, thus showing a different referral (most of the time). I say most of the time here, since occasionally the generated random numbers might overlap showing the same referral consecutively for a couple of times.

When it came to the implementing the idea part, I was at a total loss as I'd no clue about writing sidebar widgets. However, I'm extremely adept at making meaning out of existing code and modifying it to suit my purposes. I acquired half my PHP knowledge that way. So even here, I picked a AdSense widget plug-in that seemed the easiest to decipher and recode. The plug-in I chose was Google AdSense Widget written by Mike Smullin. It took me about half-an-hour to read through the code and another one hour to get it to do what I wanted. The result was GARR or Google AdSense Referral Rotator, which I'm sharing with you here.

Requires:

Wordpress Sidebar Widgets Plugin

Download:

Google AdSense Referral Rotator Widget

Installation:

  1. Installation is really easy. Unzip the file and upload the contents to your /wp-content/plugins/ directory.
  2. In the Administrative Control Panel, go to the Plugins tab and Activate the widget.
  3. It will now show up in the Sidebar Widgets screen under the Presentation menu. It'll be located in the spare widget tray. You can simply drag and drop it on to any sidebar you wish.
  4. Once placed in a sidebar you'll notice a small icon next to the widget title. Click on that to open the configuration panel. Here's a screenshot of the panel…
    IPB Image
  5. Enter your AdSense client ID (google_ad_client) here.The default referral ad size (google_ad_width x google_ad_height) is set to a small button 120 x 60 pixels. You're free to modify it any of the other standard sizes supported by Google.Make sure you modify the google_ad_format too in case you change the width and height. The available referral ad formats can be viewed by logging into your own AdSense account and visiting this page.
  6. You'll notice a separate section below the general parameters with four fields titled Referral#1, Referral#2 and so on… they contain the ad code for the four different referral types available through AdSense at the moment.If there are further referrals added in future, I'll upgrade the plug-in to reflect that. In fact I'll try to modify the widget to enable users to add as many referrals as they want.
  7. Once done with your settings, click on the close (X) button and Save the settings…and you're done.
Now your widget will show up in the sidebar and display different referrals on every page load.

Live Example:

If you want to see a live example, navigate to the Home link of my site and you can see the widget in action on the right-most sidebar around the middle of the page right after the Categories. If you refresh the page a couple of times, you'll notice that you're shown a different referral on most occasions.

Any Problems?

If you face any problems with installation / configuration, feel free to leave a comment and I'll try to reply as soon as possible.

Comments & Feedbacks are more than welcome…

 

 

 


Comment/Reply (w/o sign-up)

knight17
Nice add on .
But I can't see ads in your page ????
Any problems..

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
Are you using Firefox and have the AdBlock Plus extension installed ?? That might be the problem as AdBlock Plus is enabled by default for all pages. You've to disable it for my domain to be able to see the ads...

Regards,
m^e

Comment/Reply (w/o sign-up)

richie
this addon seems to be good, i also heard of a plugin that helps you insert adsense on your post by adding a code like<!adsense> and you caninsert adsense anywhere ,just hoping if this rotator could be integrated with that plugin

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
QUOTE(richie @ Dec 28 2006, 03:47 PM) *
this addon seems to be good, i also heard of a plugin that helps you insert adsense on your post by adding a code like<!adsense> and you caninsert adsense anywhere ,just hoping if this rotator could be integrated with that plugin


The plugin you're talking about is called AdSense Deluxe+ brought to you by Acme Technologies. I haven't really studied their code so far - but I don't think it'll be all that difficult using the referral code with their product. They take whatever raw adsense code you provide and insert it in your desired location in the posts. However, as far as I know their ads placement is limited to posts only while the one I came up with acts as a sidebar widget, which you can drag & drop and place anywhere in your sidebars.

 

 

 


Comment/Reply (w/o sign-up)

quinciest
thanks for the information
i'll install it in my wordpress
thanks dude

Comment/Reply (w/o sign-up)

livingston
thanks for sharing the resource, I was looking for a good Adsense component for my Wordpress blog and finally found one.

Comment/Reply (w/o sign-up)

dhanesh
Cool .. Thankx for the plugin m^e, will impliment it on my blog soon. But just a thought reading all the posts in here. Wouldent it be nice to have a widget plugin that also impliments google ads in posts too ?

Easier said than done, but i tried a few plugins for adsense and nothing seemed to work correctly on the WP 2.1 installation. Some show random PHP code and some just increase the width for the blog template in IE.

Would be nice to see a Text ad implimentation on posts in your wordpress widget modification wink.gif Keep your mods and findings&nbsp; comming ..

Regards
Dhanesh.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : wordpress, google, adsense, referral, rotator, plug

  1. Twitter-like Wordpress Theme
    (0)
  2. Afraid Of Updating My Wordpress
    (2)
    currently i have a wordpress version 2.3.1, but wordpress currently release version 2.3.2. but i
    dont know how to update it, im simply afraid of updating it it might be i'll be loosing my posts
    and comments when i update it. i've already searched a lot of articles about updating wordpress
    but still i can't follow their instructions they're not clear at all. could someone give me
    clear instructions to update my worpress... please thanks .......
  3. Best Wordpress Skin You Can Find.....
    The Free WordPRess Skins (2)
    Theme 1 (This mac like skin has to be the best I've seen so far.)
    http://perishablepress.com/press/2006/01/09/apathy-theme/
    http://wpdesign.downloadyour.com/index.php...ol+Elegant+Blue
    http://templates.arcsin.se/wp-demo/fluid-solution/
    http://perishablepress.com/press/wp-conten.../garbage_Fx.gif
    http://www.blogohblog.com/wordpress-theme-silver-light/ http://tarskitheme.com/
    http://wpthemesplugin.com/mezzo-3-column-wordpress-theme/ http://naturalparenting.wsnw.net/blog/
    http://kathymoore.daynote.com/blog It is actually a modified version of the....
  4. Tips For Modifying Wordpress Code
    How to make it work the way you like (1)
    Some time ago I decided to convert my current web site (done in Joomla! CMS) to WordPress. Mostly
    because it is less bulky when compared to Joomla! CMS and has exactly the functions I need, unlike
    Joomla, where I found numerous options which I didn't need. Of course, as every professional web
    master (yes, I like to see myself as pro /tongue.gif" style="vertical-align:middle" emoid=":P"
    border="0" alt="tongue.gif" />), I wasn't completely satisfied with the way WordPress delivers
    content, and so I decided to modify its code in order to make it perfect. Unfortuna....
  5. How Do I Customize Wordpress
    to look like an ordinary website (6)
    how do i? nuff said....
  6. All New Wordpress Plug-ins & Widgets By M^e
    (0)
    A bit of self advertising /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0"
    alt="biggrin.gif" /> I've been dabbling in WordPress plug-ins for a while now and have
    successively come up with quite a few. Here's the list so far. If you find them useful, feel
    free to grab them off my site and use in your own blog. Some of them are Sidebar Widgets , which
    means you'll need a widget enabled theme for WordPress. The others are simple plug-ins meant to
    perform other tasks. Here's the list... GARR (Google AdSense Referral Rotator) - A sideb....
  7. Wordpress Widgets Drag/drop Bug ..
    (3)
    For those of you new to widgets like me, I downloaded a new version of the widgets plugin from
    automattic.com >> HERE Problem: Everything seems to be installed fine according to the
    readme, the plugin activated, the scriptaculous files are in wp-include/js/scriptaculous. But when
    you go to the plugins page You cannot drag/drop the widgets. All that happens is you get the cross
    cursor but the widget box gets highlighted (selected ) when u click and try to drag the widgets.
    Solution: Find this in widgets.php (at line 203): wp_enqueue_script( &#....
  8. Wordpress 2.0.6
    Latest Release (8)
    There has been another release of WordPress after the Wordpress Ronan version, or Wordpress 2.0.5
    version. Quoting from wordpress.org: QUOTE We have a pretty important release available for
    everyone, it includes an important security fix and it’s recommended that everyone upgrade. This is
    the latest release in our stable 2.0 line, which we’ve committed to maintaining for several more
    years. Here’s what’s new: * The aforementioned security fixes. * HTML quicktags now work
    in Safari browsers. * Comments are filtered to prevent them from messing up your ....
  9. Wordpress Url Display Problem
    The domain name does not get reflected (2)
    OK. I have a AstaHost account here: http://kmaheshbhat.astahost.com I also have a domain name
    parked: http://www.WiseTome.com On the root public_html, I have installed Drupal, and it is
    running fine. Now, I installed a WordPress engine in public_html/cao directory. And it works out
    fine. When I type http://www.WiseTome.com/cao it properly goes to the blog. But after it goes
    there it shows it as http://kmaheshbhat.astahost.com/cao That is annoying. It should show it as
    http://www.wisetome.com/cao itself! I even went to the admin login of WordPress and chang....
  10. Wordpress Theme Help
    (3)
    Aight .. I liked this wordpress theme called DFire, and m trying to use it on my Blog. In its
    default state DFire looks good (visually) but the reading part kinda looks odd. I thought of
    changing the font and color etc .. but since i am no good at CSS .. lol .. i thought maybe someone
    here could help .. DFire Theme Download Current Style.css : CODE body {     font-family:
    verdana;     font-size: 12px;     color: #FFFFFF;     text-align: center;     background: #E1B26B
    url("images/bg.gif");     margin: 0;     padding: 0;     } /* Design Containers and Specifi....
  11. WordPress Theme Help Needed
    (0)
    I want to put this wordpress theme >>LINK . I can manage everything else except when it comes to
    PHP and CSS. This is a 1 Column theme. Could someone help me make this a 2 Column theme ? Go to the
    link and click test run. Now Lets say i shift the entire writing area to my left .. could i get a
    line/divider and the right could be made as a 2nd column with links and stuff ? Regards Dhanesh. ....
  12. Wordpress 2
    Have you already upgraded? (4)
    I did the upgrading today... and man was it worth it. First of all the upgrading went really
    smoothly and I had no problem getting my theme and plugins to work with it. The new admin panel is
    just awesome. Writing there is like working with a text processor. I have a lot of categories and
    keep always adding more and it's really handy that I can add them while I write the post, not
    needing to save as draft and go to the categories page to add a new one and then edit the post
    again. Same goes for files. ....
  13. Wordpress Cannot Find Db
    (6)
    Hy! I try to install Wordpress 1.5 on my new astahost account, but the installation always says...
    "We were able to connect to the database server (which means your username and password is okay)
    but not able to select the rockfm_db database. Are you sure it exists? On some systems the name of
    your database is prefixed with your username, so it would be like username_wordpress. Could that be
    the problem? If you don't know how to setup a database you should contact your host. If all
    else fails you may find help at the WordPress Support Forums." I tried to edit ....
  14. Wordpress Rss
    i need to understand (1)
    could someone help me understand the way wordpress creates rss feeds. i need to figure out what the
    address will be to my feeds so that i can put them up on the website so that visitors who are not
    very tech can easily access them. my experimental feed is here . is the address needed by a
    feeder - thundebird for example - just that address + /feed.bla or something. i tried /atom.xml but
    that didnt work and i sort of got stuck. thanks in advance....

    1. Looking for wordpress, google, adsense, referral, rotator, plug

See Also,

*SIMILAR VIDEOS*
Searching Video's for wordpress, google, adsense, referral, rotator, plug
advertisement



Wordpress: Google Adsense Referral Rotator Plug-in

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com