This tutorial shows you how to display Google Adsense ads on your Joomla! 1.7.x website without installing an extension.
Requires you have a Google Adsense account. Should work for other ad providers that provide you with a code snippet for ads on your site.
Joomla! 1.7.0 has backend compatibility problems with IE 8 (and possibly other browsers). These instructions worked using FireFox 6.0, but will not work using IE 8 because you will be unable to edit the Global Configuration page using IE 8.
NOTE: Joomla! 1.7.1 does not have this problem and works as expected.
Some images may be clicked for larger sizes.
It is very easy to place Google Adsense ads on your Joomla! site without installing an extension.
Yet, the last time I looked, there were dozens of different Joomla! extensions to help you with Google Adsense ads on your site.
Embedding ads directly within your article requires a plug-in and is not covered by this tutorial.
Determine Ad Placement
You need to find a place for the ads on your site.
Ads are typically placed at the:
- top of the page
- bottom of the page
- side of the page
See this article on how to enable Joomla 1.7 to display module positions.
To reveal the module positions available in your Joomla! template, append
to the end of your URL. As shown below, the various module positions available on this site are revealed:
You can choose to place ads in a currently empty module position, for example: position-6, position-8, position-3, position-0, position-12, position-2 , position-9, position-10, position-11 or position-14 in the case of this template. Or you can place them in already occupied module positions, for example, position-5.
Where you place the ad will determine the type of ad you place. For instance, if you choose to place an ad on the left position, then a narrow and tall ad makes more sense than a short, wide ad.
Remember the name of the module position where you want to place your ad.
Disabling the HTML Editor
Joomla! tries very hard to prevent users from entering malicious code. This also means it prevents adding legitimate code. To get around this we need to disable the HTML editor. A compatibility problem between Joomla! 1.7.0 and IE 8 means you will need to use a different browser to do this. FireFox 6.0 worked for me. Joomla! 1.7.1 does not have this problem.
1) Select Global Configuration from the Site menu item:
2) Select Editor – No Editor for the Default WYSIWYG Editor:
3) Click on Save & Close to save the changes:
After you are done, you can restore the editor to the TinyMCE editor (or which ever editor you were using).
4) Click on Article Manager from the Content menu (non-intuitive, I know):
5) Select the Options icon:
6) Click on the Text Filters tab:
7) Scroll down to Super Users and select No Filtering from the dropdown box.
NOTE: this step assumes you are logged in as an administrator and thus have super user privileges.
8) Scroll back up and click on Save & Close:
After you are done, you can restore the option to Black List (default).
You require an Adsense account.
You also need the HTML code Google will provide you for your ad.
1) Select Module Manager from the Extensions menu item.
2) Click on New to create a new module.
3) Click on Custom HTML:
4) Fill in the module information.
- Title: enter a title for this module. If you want to display the title, something like Sponsored by is a good choice.
- Show Title: select Yes to display the title, No to not display the title.
- Position:·from the dropdown list, select the name of the module position you decided on when determining your ad placement
- Status: set to Published to show / display the module.
- Access: ensure Public is selected.
- Order: if there are other modules occupying your selected position, you can choose the ordering of the modules.
- Start Publishing: leave empty.
- Finish Publishing: leave blank
- Language: leave as All.
- Note: optional note to display in the module list.
This is where you paste the HTML code that Google Adsense gives you.
Advanced Formatting Trick
It is likely that the ads will be left justified in the module position.
You can horizontally center the ads by adding
before the HTML code Google Adsense gave you and adding
at the end of the Adsense code.
Ensure On all pages is selected. This will place the ad module on all pages of your Joomla! site.
If you want some pages to be ad free, then select one of the other Module Assignment options (No pages, Only on the pages selected, or On all pages except those selected) and then select only those pages were you want the ads to appear or not appear.
5) Click on Save & Close
6) Observe that the module has been correctly installed. To locate the newly created module, I find it easiest to click on the ID column and sort the column in descending order (the newly created module will have the largest module number):
7) Check that the ads show up and are correctly positioned on your site (in this case, I created a single Adsense module in position-10: