This tutorial shows you how to display Google Adsense ads on your Joomla! 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.
Intructions for installing Adsense under Joomla! 1.6 can be found here.
Some images may be clicked for larger sized versions.
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
To reveal the module positions available in your Joomla! template, simply type in
at the end of your URL. As shown below, the various module positions making up this site are revealed. NOTE: in Joomla! 1.6, viewing module positions with ?tp=1 is disabled by default. See this tutorial for instructions on how to enable it.
You can choose to place ads in a currently empty module position, for example: user1, user2, search, topnav, breadcrumb, banner or right in the case of this website. Or you can place them in already occupied module positions, for example, left.
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.
1) Select Global Configuration from the Site menu item.
2) Select Editor – No Editor for the Default WYSIWYG Editor.
3) Click on Save to save the changes.
After you are done, you can restore the editor to the TinyMCE editor (or which ever editor you were using).
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 (You could also select the radio button next to Custom HTML and then click on Next).
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.
- Enabled: select Yes to enable (show / display) the module.
- Position: from the dropdown list, select the name of the module position you decided on when determining your ad placement
- Order: if there are other modules occupying your selected position, you can choose the ordering of the modules.
- Access Level: ensure Public is selected.
Ensure All is selected. This will place the ads module on all pages of your Joomla! site.
If you want some pages to be ad free, then select Select Menu Item(s) from the List and then select only those pages were you want the ads to appear.
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. Check the highlighted code in the image.
5) Click on Save
6) Observe that the module has been correctly installed:
7) Check that the ads show up and are correctly positioned on your site (in this case, I added created two Adsense module – one for position user1 and the other for position user2):