This article will give you a step by step guide on how to put Google ads on your Elgg Community site. Before we begin, please sign up for a Google Adsense account.
Google Adsense is a great tool to display ads on your site and make money out of them. Today I will show you how to put them on a profile page and also on the Elgg Dashboard.
The screenshot above is a profile without ads. To put ads on every profile page, follow these steps:
1. Go to YourElggFolder/views/default/canvas/layouts. Locate and open the file widgets.php.
2. Look for this chunk of code:
3. Go to Google Adsense and create an Ad. The size recommended for an ad in the profile is 300×250. After you create an ad, it will give you a code. Copy and paste that code below the widgets_right div tag, like this:
4. Save the changes. Refresh the profile page and ads will be at the left side of the profile description:
That’s for the profile area. Now, we move on to the Dashboard area.
The picture above is a screenshot of the dashboard without ads. To put ads where the picture indicates, please follow these steps:
1. Go to YourElggFolder/mod/riverdashboard/views/default/riverdashboard. Locate and open the file newestmembers.php.
2. Find the div class clearfloat:
3. Go to Google Adsense and create another Ad. The size of this one is going to be 160×600. After you create the ad, it will give you a code. Copy and paste that code below the clearfloat class, like this:
4. Save the changes and refresh the dashboard. The ad should appear like this:
And that’s it.
For more info about Elgg hosting solutions please visit Arvixe-Elgg Hosting