Quick Notes On Google Adsense Sidebar Widget for Wordpress

Adsense on WordpressIn my earlier post, I contributed my updated version to Google Adsense Sidebar Widget on Wordpress based on  previous work by Mike Smullin. I received some comments about errors in implementing the widget. This weekend, as I mentioned earlier, I decided to take further investigation to know the root cause of the malfunction.

I compared two references i could find. The first is right from the dashboard of my Google Adsense publisher account and the later is Google’s documentation for Adsense API. There should be another reference from Mike Smullin’s own work but since he’s now charging for the plugin, I’d better have someone send me the plugin to be analyzed and synchronized with my update.

After reading the documentation and  toying with my account, I’d like to provide some notes regarding google adsense implementation:

1. Google Adsense API

This API provides programmatical way to modify and manage the ads. It uses SOAP web service with available callbacks listed in its published WSDL. The API will enable a user to manage his adsense account without logging in into his Google Adsense account. Instead, the third party application communicates with Google server to update the modification executed by user while utilizing the application.

However, Wordpress widget expects simple configuration values for each of the widget. Rearchitecting existing widget to support SOAP communication is a bit out-of-boundary and redundant. I’ll explain this in the subsequent point.

2. Google Adsense Code Variables

Currently, the automatically generated google adsense javascript code contains only the following four variables:

  • google_ad_client :referring to publisher ID
  • google_ad_slot :referring to ad block ID
  • google_ad_width :referring to ad block width
  • google_ad_height :referring to ad block height

From above variables, google_ad_client and google_ad_slot are both unique. The first variable is used to track the publisher earning for the displayed ads and the second one is used to save the display or style configuration for the ad block. You might have noticed earlier that there is no configuration for background or font color in currently implemented javascript code. Where have they gone?

Before the adsense engine was improved, you’re unable to modify the previously created ad block. The old engine did require publisher id and channel id but it didn’t save the layout configuration of the ad block serving the channel. As a consequence, you had to recreate new ad block and assign it to specified channel if you wanted to update the styling of existing ad block. The new adsense engine is surely a time saver. However, as you might have seen the notice in your publisher account, an ad is un-deletable once it’s created. For some people who are conservative with the tidiness, this can be gruesome since they can still see ad block record which was created, say, for testing purpose (but hey, Google provides the “hide” feature).

Nevertheless, given this improvement, it will be much faster and more effective to manage the styling of your adsense ad right from the Google Adsense hood, right? You get all the controls and expected latency from Google’s infrastructure. Transforming the functionalities into another web-service based application won’t guarantee better user experience. Also, as another side note, the Google Adsense API documentation seemingly needs some update.

And now, with the improved adsense, you still have difficulty displaying your ad using Adsense Sidebar Widget on your Wordpress blog? Let’s go to the next point.

3. The widget works fine but I’ve got some ideas to make it better

It’s a bit strange for me when I got some comments saying that they got no ads displayed. I’ve delved into the code that I use on this blog and come into conclusion that either the value entered in the configuration was invalid or something was wrong with the uploaded file. Hence, I have reuploaded the file and now you can download it from this url:

Google Adsense Sidebar Widget for Wordpress (27)

Another update for this plugin will follow, please stay updated and put your comments or suggestions regarding this plugin in the comment section of this post.

Update: For Wordpress >=2.6, simply unzip the file and then upload it to the plugins folder. Next, you need to activate the plugin by clicking “Plugins” menu on your admin dashboard. You can later use and modify this plugin by navigating to “Design” > “Widget” and add Google Adsense widget to the list of current widgets. Before using it at the first time, you should configure it by clicking on the “Edit” link followed by clicking “Save Changes” button.

Please add your wishlist and comment after this post.

1 Response to “Quick Notes On Google Adsense Sidebar Widget for Wordpress”


  1. 1 Adsense Widget For Wordpress Sidebar: Updated Version at Amikelive | Technology Blog UNITED STATES Pingback on Dec 1st, 2008 at 2:35 am

Leave a Reply






Worth Trying

Subscribe to RSS

  • Subscribe via Feed Burner