Google Adsense Widget

Posted on Tuesday the 27th of June, 2006 at 1:56 am in Widget

After 24 grueling hours slaving over a hot computer, I have completed the Max Adsense widget to make the process of adding ads easier than counting all the money you’re sure to reap. The widget is made is such a way that everything you can do in the Google Adsense control panel (except anything that requires being saved such as saving channels, pallets etc.) is built directly into the widget. It evens has a wonderful (if I do say so myself) color picker to make it even easier to design your ads and alows up to 4 widgets*. If the widget is popular I may even add a few more features such as a dynamic example ad etc. However, the widget does not make referral buttons, there are too many of each kind to add into one little widget.
Screen shot (click thumbnail to see larger image, although it is still scaled down):
Screenshot of Google Adsense Widget Control Panel
All it requires is a Google Adsense account and the widgets plugin for wordpress.
To Install:

  • Unzip max_ad.zip.
  • Copy the two files in the max_ad folder into your plugins > widgets directory.
  • Activate the widget in your control panel.
  • The only thing else you need is your publisher id from google. It can be found in top line of any of your old Google ad codes and looks like pub-23456765434

Other than that most of it should be self explanatory. But feel free to ask any questions.

Download:Max Adsense

*Thanks to Otto for making his execphp widget which I heavily borrowed code from to allow multiple widgets.

Change log:
6/27/06: Fixed a bug where the javascript in multiple ad widgets would only effect the first widget.

  1. ovidiu posted the following on February 1, 2007 at 5:15 am.

    hello,

    I just had a look at your widget and it looks great. I am just curious if it would work in an wpmu environment. What is important to know is where and how it stores the settings, to know if it would store the settigns for each blog owner separately or not, it it would be possible to hardcode my own adsense ID into the script with a fixed rate, so that my adds would be displayed 20% the blog owners ads 805 of the time, as an example…

    Reply to ovidiu
  2. Aaron posted the following on February 1, 2007 at 1:15 pm.

    I’ve never tested it in WPMU, but I’ve just read through MU’s code and I don’t see anything that would cause problems. I also know that this plugin has been suggested on the WPMU forums a few times.

    Hard-coding your id is easy.

    1. if(rand(4) == 4){
    2. $user_id = 'Your ID Here;
    3. }
    4. Use the following to copy and paste the code.

    Just add that before echo $before_widget . $before_title . $title . $after_title;

    Reply to Aaron
  3. Kenny Pennington posted the following on March 28, 2007 at 9:01 pm.

    I tried this widget, but could not get it to work. It just leaves a blank space where the widget should be, but the title is not inserted and no ads appear. Any ideas?

    Reply to Kenny Pennington
  4. Aaron posted the following on March 28, 2007 at 9:18 pm.

    There really hasn’t been any developement on this for almost a year now, so I’m not really sure of where it could be going wrong. I’ll try to get to it over this weekend.

    Reply to Aaron
  5. Chad Riden posted the following on April 25, 2007 at 2:57 pm.

    download link is broken

    Reply to Chad Riden
    1. Aaron posted the following on April 25, 2007 at 10:48 pm.

      Fixed.

      Reply to Aaron
  6. lampsie posted the following on June 13, 2007 at 12:07 pm.

    Hi,
    I to am seeing just blank entries after populating the configuration screen. I’m on wordpress 2.2 which ships with Widgets by default :)
    Thx,
    Lampsie

    Reply to lampsie
  7. Sarah posted the following on June 14, 2007 at 3:45 pm.

    This may be a silly question, but I’m getting this error message when I try to launch the widget in WordPress:

    Warning: include(../wp-content/plugins/widgets/max_adsense_options.php) [function.include]: failed to open stream: No such file or directory in /home/thesexys/public_html/wp-content/plugins/max_adsense.php on line 137

    Warning: include() [function.include]: Failed opening ‘../wp-content/plugins/widgets/max_adsense_options.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/thesexys/public_html/wp-content/plugins/max_adsense.php on line 137

    Can anyone help?

    Reply to Sarah
    1. Aaron posted the following on June 16, 2007 at 12:49 pm.

      Make sure all riles in the zip were uploaded correctly; however , I’m not even sure if the plugin will still work as it hasn’t been updated or tested in over a year.

      Reply to Aaron
    2. parimal posted the following on August 27, 2008 at 3:26 am.

      Hi Sarah,
      I am having the same problem. Exactly same error.
      If you find the solution please let me know by email.

      Thanks
      http://healthlifestyleforever.com/blog

      Reply to parimal
      1. endymion posted the following on March 3, 2009 at 9:24 am.

        In the file “max_adsense.php” rename this:(“../wp-content/plugins/widgets/max_adsense_options.php”)
        to this:
        (“../wp-content/plugins/max_ad/max_adsense_options.php”)

        Reply to endymion
  8. derek posted the following on June 28, 2007 at 2:01 am.

    Hi!

    Does your plugin support section targeting? I am currently using adsense deluxe, and even if I have the code for section targeting it doesn’t show relevant ads on my post. You can take a look at my site http://yuwoncedric.com

    Reply to derek
  9. Aryan posted the following on January 9, 2009 at 8:35 am.

    Thanx Buddy This Remains Very helpful for me. http://www.funwithfriendz.com

    Reply to Aryan
  10. rahul posted the following on January 26, 2009 at 1:10 am.

    It works like a charm. I was having problems with the size though
    http://www.fashionhub.co.nr

    Reply to rahul
  11. Marcus posted the following on July 4, 2009 at 12:34 am.

    when i put my adsense widget up in blogger there is also a blank space that takes up the same amount of space the adsence panel would. but only on the side

    Reply to Marcus
  12. imanifest wealth posted the following on February 28, 2010 at 2:08 pm.

    Can’t seem to get the adsense blocking feature to work. My post are named by title, not ID post.

    Tried to enter the test , but the adds still pop up on posts that I want to exclude. Can anyone help?

    Reply to imanifest wealth
  13. Ron posted the following on June 7, 2010 at 10:12 pm.

    Just a quick mention…your docs say to upload php files to your plugins/widgets directory. WP has a plugins but not a subdir of that to widgets. This is using WP 3.0.1RC but I didn’t see one in 2.9.2 either. Easy enough to edit the php file but you might just wanna change that out and save the user the trouble. :D

    I’ll see if this works. Something tells me I gotta have more than a pub number but we’ll see.

    Thanks by the way
    Ron

    Reply to Ron
    1. Aaron posted the following on June 8, 2010 at 5:43 pm.

      Hi Ron,

      Glad you are trying to use my plugin, but it was written almost 3 years ago for WordPress 2.0, so it hasn’t worked in a long time.

      I may look into reviving and revising it eventually, but I have other projects that are taking up my time.

      Aa.

      Reply to Aaron
      1. Aaron posted the following on June 8, 2010 at 5:44 pm.

        Actually, it was written 4 years ago in 2 weeks. :|

        Reply to Aaron
  14. Ron posted the following on June 7, 2010 at 10:29 pm.

    Lemme drop in another quick post…first read the earlier post about editting php before I posted min so, sorry but that’s the answer.

    The blank page appearing after installing the the widget may be due to the Save Widget function in WP not saving all your info. If I edit, save, and enter the edit screen again, the only info I see is the selection I made for sidebar location. Nothing else seems to save. Additional info to conclude that it’s not saving is by my viewing the website from another browser and refreshing after saving widget. I note that even tough I chose a different size box, it seems to default back to another size. The widget would be ultra-cool if you can get that fixed. Many a WordPress user would be thankful for the time you save them having to attempt to insert html code on a php page. Here’s an idea, once it’s fixed, sell it to Google. They can’t seem to get past inserting code.!

    Thanks again
    Ron

    Reply to Ron
  15. Hafiz posted the following on September 22, 2010 at 3:16 pm.

    Get Google Adsense Account in Just 10$ (USA , Europe , Pakistan, India, Bangladesh , etc.

    within 4 hours (Guaranted).
    After approval i’ll send you Screen shot of your account and you can pay me to get your

    account.
    Price Negotiates For More than 1 Account.
    Email: webdiziner01@gmail.com
    Cell : +92 323-4208304

    Reply to Hafiz
  16. Gurgaon posted the following on January 22, 2011 at 7:16 am.

    Thanks for the plugin.

    Reply to Gurgaon

Leave a reply

:) :D :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: ;) :!: :?: :idea: :arrow: :| :mrgreen: