Adding Google Adsense ads to Joomla 3.x

Advertising on your site using Google Adsense is a simple way to earn money from your site visitors. This tutorial will describe how to place a Google Adsense ad on your Joomla! 3.1 site.

You will need the following:

  • The location on your site where you will be placing your ad. This depends entirely on how you want the ad to look (tall and skinny, short and wide, a box, etc.) and where the template you are using for your content pages has room.
  • A Google Adsense account ( In this account you should have created an ad of the size you want. I have several ads I use, the one I’m using in this tutorial is 120 pixels wide by 620 high.


In this example, the template I am using (Pixeldot fromĀ has a position labeled as “right” on the template. I’ll be placing a tall and skinny ad (120 px wide by 620 px tall) on my pages along the right hand side. In fact if you look to the right on this page you should see an ad from Google.

The Joomla! banner model supports three important concepts, clients, categories and banners. A client is who is supplying the advertisement, a category is used to group ads from one or more clients and a banner is the actual representation of a single ad (or in this case, the JavaScript from Google that displays the ad).

Let’s start first by setting up Google as a client. A client is the organization that is paying you (hopefully!) for placing their ads on your site. They may have a budget for impressions or clicks or have other constraints. Google adsense has none of these, but it’s helpful to create a client for Google anyway so you can track impressions and clicks.

Log in to your Joomla! 3.1 site as administrator and click on the Components Menu, select Banner and then Clients.

Joomla, PHP