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 (1292 downloads )

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.

For users who run WordPress >= 2.8, you can now download the updated widget which is compatible with the WordPress versions from this url.

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.

9 thoughts on “Quick Notes On Google Adsense Sidebar Widget for WordPress

  1. Pingback: Adsense Widget For Wordpress Sidebar: Updated Version at Amikelive | Technology Blog

  2. Sqter

    In order to activate the plugin I had to add parenthesis to the ‘unset’ function in line 109. Otherwise I was getting a parse error.

    Reply
  3. not working!

    plugin doesnt work on WP 2.7 i get:
    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/wordpress/wp-content/plugins/adsense.php on line 103

    need some help here please

    Reply
  4. gapp

    error on activation on wp 2.8:

    Parse error: syntax error, unexpected T_VARIABLE, expecting ‘(‘ in /var/www/html/wp-content/plugins/wp-adsense-widget-aml-20081101/adsense.php on line 109

    Reply
  5. Tech Admin Post author

    @gapp
    oops.. it seemed i posted an older file which contained error.
    you should add parantheses to line 109 in order to get the file working. however, i have fixed this small issue.

    i haven’t checked this plugin for WP >= 2.7. as soon as i get more time to post and tinker with this stuff again, i will post an update.

    thanks for your comments.

    Reply
  6. Pingback: A Simple Adsense Sidebar Widget for Wordpress at Amikelive | Technology Blog

  7. Pingback: Easy and Simple Adsense Sidebar Widget for Wordpress | www.mudahonline.com

  8. maria

    i tried for google adsense 4 times but they refuse me all the time show messange in dashboard that your account it disable… how can i know the cause of messanger like that??

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *