Simple AdSense Insert


Simple AdSense Insert is a WordPress plugin that provides a basic ability to display AdSense adverts on your blog.

Are you having problems with Simple AdSense Insert? The user voting on the WordPress download page would suggest there are problems, but none have been reported to me! If you are having any kind of issue, then please let me know.

Download

Download Simple AdSense Insert (v1.2, 02/03/2010)

Changelog

Version 1.0

  • Initial release

Version 1.1

  • Tidy up of code

Version 1.2

  • Parameters now sent via single string to plugin
  • Google script checked
  • Code optimised

Installation

  1. Upload the entire simple-adsense-insert folder to your wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. There is no options screen – configuration is done in your code and, optionally, by modifying the plugin.

Configuration

If you’ve not done so already, create your AdSense advert. The code you are provided provides the parameters that are required by Simple AdSense Insert. The following is an example of the AdSense code, in this case for my own site…

<script type="text/javascript"><!--
google_ad_client = "pub-0743991857092062";
google_ad_slot = "5828977680";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

If your code looks a lot different to the above and, in particular, you don’t have a google_ad_slot then you may have some old AdSense code – please return to the Google AdSense website and create it again.

The 4 pieces of information you require are the values in google_ad_client, google_ad_slot, google_ad_width and google_ad_height. To display your AdSense advert you will need to insert the following code, where appropriate, into your theme…

<?php simple_adsense_insert('client=pub-0743991857092062&slot=5302103070&width=468&height=60'); ?>

In the above example, I’ve used my credentials, but you will need to use the details that I suggested you note before, as supplied by AdSense.

The client= is your publisher ID (i.e. google_ad_client), slot= is google_ad_slot, width= is the width of the advert (i.e. google_ad_width) and height= is the height of the advert (i.e. google_ad_height).

Alternatively, if you wish to ensure that your code still works correctly, even if Simple AdSense Insert is switched off, you can use the following format of code…

<?php if (function_exists('simple_adsense_insert')) simple_adsense_insert('client=pub-0743991857092062&slot=5302103070&width=468&height=60'); ?>

My AdSense code doesn’t have a slot number

Ah, yes. Google changed the format of their AdSense code – if you’re looking at some existing AdSense code and it doesn’t look the same as my examples, then head back to the AdSense website and get it to create the code again.

Problems/Queries

Please report any problems, or suggestions for enhancements, to me either via my contact form or by commenting on the appropriate entries on my blog.

Updates

Updates to this and any other of my WordPress plugins will be published on this blog.

Subscribe to my WordPress category feed..


Share this on del.icio.us Digg this! Email this Share this on Facebook Share this on LinkedIn Send this page to Print Friendly Share this on Reddit Share it on StumbleUpon Tweet This!

2 Comments


  1. This plugin is so useful. I ocassionaly run on it, but this is exactly what I needed in past


  2. Adsense is my main source of income when making money online. nothing beats adsense when it comes to making money online.

12 Pingbacks/Trackbacks

No Tweetbacks


  1. This plugin is so useful. I ocassionaly run on it, but this is exactly what I needed in past


  2. Adsense is my main source of income when making money online. nothing beats adsense when it comes to making money online.

Leave a Comment

All comments are authorised before appearing - you should receive an email once this has been done.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

46 queries in 0.931 seconds.