Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Wordpress: Google Adsense Referral Rotator Plug-in
miCRoSCoPiC^eaRt...
post Dec 21 2006, 05:29 PM
Post #1


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



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…
Go to the top of the page
 
+Quote Post
knight17
post Dec 22 2006, 12:06 AM
Post #2


Advanced Member
Group Icon

Group: Members
Posts: 145
Joined: 6-October 05
Member No.: 8,941



Nice add on .
But I can't see ads in your page ????
Any problems..
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Dec 22 2006, 05:04 AM
Post #3


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



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
Go to the top of the page
 
+Quote Post
richie
post Dec 28 2006, 08:47 AM
Post #4


Member - Active Contributor
Group Icon

Group: Members
Posts: 98
Joined: 16-December 06
Member No.: 18,408



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
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Dec 29 2006, 08:14 AM
Post #5


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



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.
Go to the top of the page
 
+Quote Post
quinciest
post Jan 31 2007, 07:03 AM
Post #6


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 41
Joined: 30-January 07
Member No.: 20,045



thanks for the information
i'll install it in my wordpress
thanks dude
Go to the top of the page
 
+Quote Post
livingston
post Feb 14 2007, 10:08 AM
Post #7


Advanced Member
Group Icon

Group: Members
Posts: 149
Joined: 14-February 07
From: Tuticorin, India
Member No.: 20,415



thanks for sharing the resource, I was looking for a good Adsense component for my Wordpress blog and finally found one.
Go to the top of the page
 
+Quote Post
dhanesh
post Feb 14 2007, 07:35 PM
Post #8


Binary Geek
Group Icon

Group: Members
Posts: 444
Joined: 4-November 05
From: The Digital Arena
Member No.: 9,440



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Wordpress 2(4)
  2. WordPress Theme Help Needed(0)
  3. Wordpress Theme Help(3)
  4. Wordpress Url Display Problem(2)
  5. Wordpress 2.0.6(8)
  6. Wordpress Widgets Drag/drop Bug ..(3)
  7. All New Wordpress Plug-ins & Widgets By M^e(0)
  8. How Do I Customize Wordpress(6)
  9. Tips For Modifying Wordpress Code(1)
  10. Best Wordpress Skin You Can Find.....(2)
  11. Afraid Of Updating My Wordpress(2)
  12. Twitter-like Wordpress Theme(0)


 



- Lo-Fi Version Time is now: 7th October 2008 - 06:56 PM