googleAds plugin
Written by kksou   
Thursday, 29 May 2008


This plugin allows you to display Google Ads right inside your content pages.

All you need is to copy and paste your AdSense unit code in your content item, and enclose them with the tags {googleAds} ... {/googleAds}

You can see a live example here. I've used two ad units (one float left and one float right) and two link units.

Unique Features

Unlike many other Joomla extensions,

  • The Google Adsense code is inserted right inside your content item or article for easy maintenance.
  • You can insert and edit the Google Adsense code right inside the default TinyMCE WYSIWYG Editor!
  • You can easily add HTML and CSS tag, for example, to float the google ad left or right.
  • You can place multiple ads and ad units in the same content item!

Very Important: If you're using Joomla 1.6 or Joomla 1.7, don't forget to set the Filter Type to "No Filtering" so that you can enter the Google Adsense codes in a Joomla 1.6 / 1.7 articles. Details here (works for both Joomla 1.6 and 1.7).

If you're using Joomla 1.5, please refer to the article:
How to enter HTML tags, javascript and PHP codes in Joomla 1.5.8?
Otherwise you might find that all your HTML tags, Javascript and PHP scripts will be removed the moment you click the Save or Apply button.

Latest Version

v1.6.3 (for Joomla 1.6) and v1.7.3 (for Joomla 1.7)
Released October 23, 2011

Native version of googleAds plugin for Joomla 1.6 and 1.7!

Don't forget to set the Filter Type to "No Filtering" so that you can enter the Google Adsense codes in a Joomla 1.6/1.7 article using the default WYSIWYG editor. Details here (works for both Joomla 1.6 and 1.7).

Download

How to install (Joomla 1.0.x)

  1. Download the plugin and unzip it into a folder.
  2. From the Installers menu, select mambots. In the field "Install directory", enter the folder location (where you unzipped the file) and click Install.
  3. From the Mambots menu, select Site Mambots.
  4. Make sure the plugin "googleAds" is published. If you see a cross in the Published column, just click on it. It will turn into a green tick.
  5. You are now ready to use this plugin!

How to install (Joomla 1.5.x)

  1. Download the plugin and unzip it into a folder.
  2. From the Extensions menu, select Install/Uninstall. In the field "Install directory", enter the folder location (where you unzipped the file) and click Install.
  3. From the Extensions menu, select Plugin Manager.
  4. Enable the plugin "googleAds" - make sure there is a green tick in the Enabled column.
  5. You are now ready to use this plugin!

How to use the "googleAds" plugin

  1. To display Google ads, logon to your Google Adsense account. Go to AdSense Setup, then AdSense for Content. You can use both Ad unit and Link unit. Just grab the adsense code and enclose them in
    {googleAds} ...the adssense code provided by Google... {/googleAds}
    
  2. You can use additional HTML and CSS tags to position the Google ads. For example, the following code positions the Google ad to the right:
  3. {googleAds}
    <div style="float:right">
    <script type="text/javascript"><!--
    google_ad_client = "pub-1234567812345678";
    google_ad_slot = "1234567891";
    google_ad_width = 250;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </div>
    {/googleAds}
    

    You can view a live page in action here. I've used two ad units (one float left and one float right) and two link units.

About the Editor - WYSIWYG mode, Source mode, or No Editor mode?

  • You can enter your Google Adsense code in any of the three modes. My plugin can handle all three modes.
  • However, note that if you enter the Google Adsense code in Source mode or No Editor mode, and later switch back to the the WYSIWYG mode, please be WARNED that your Google Adsense code will appear to have vanished in thin air! (although they are still in the mysql db - just make sure you don't click Save or Apply.)
  • If this happens, make sure you DO NOT click Save or Apply. Reload the article in Source mode or No Editor mode. Copy the Adsense code. Then reload the article again in WYSIWYG mode. Now paste the code in. Your code will now be visible in WYSIWYG mode.

  • Of course, if you're one of those who never use the WYSIWYG mode and prefer to code everything in plain HTML using the No Editor mode, you can just include the Adsense codes by enclosing them within the tags {googleAds} ... {/googleAds}.

Using the "GoogleAds" plugin with "Include Content Item" plugin

  1. If you have installed the Include Content Item plugin, you can also store frequently used Google Adsense codes in a content item.
  2. When you have done this, anytime you want to display a google ad, you can just use
    {include_content_item 123}
    

    where 123 is the id of the content item containing the Google Adsense codes.

  3. Very Important: Please make sure that in the Mambot/Plugin Manager, the "Include Content Item" plugin comes before the googleAds plugin so that the Google Adsense codes are included first which will then be processed by the googleAds plugin.
  4. Note also that it is not necessary to publish those content items (containing the Google Adsense codes) that will be included.

Version History

  • v1.0 (for Joomla 1.0) and v1.5 (for Joomla 1.5)
    May 30, 2008
  • v1.0.1 (for Joomla 1.0) and v1.5.1 (for Joomla 1.5)
    Released August 17, 2008
  • Added support for PHP4.

  • v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
    Released December 9, 2008
  • fixed the warning message "Notice: Undefined offset: 0"

  • v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
    Released December 9, 2008
    • Fixed the warning messasge "Notice: Undefined offset: 0 in googleads.php on line 53"
    • Fixed the warning messasge "Notice: Trying to get property of non-object on line 42"
  • v1.0.3 (for Joomla 1.0) and v1.5.3 (for Joomla 1.5)
    Released April 16, 2010
  • added license note as per advice from joomla.org

     

    Comments  

     
    # bla2e 2012-10-24 06:58
    thank you man, it is really the easiest way
     
     
    # Writeslice 2012-11-15 09:33
    Is it possible to wrap the text around the adsense block in an article. For example I have added a 336x280 add inside the content of the article. The text does not seem to wrap around the adsense block. :-?
     
    < Prev   Next >

    Blog - Forum - Privacy Policy - Contact Us
    Copyright © 2006-2015. kksou.com. All Rights Reserved