How to Integrate Google Adsense in Your Elgg Site

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.

Profiles:

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.

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

Happy Hosting!

Rodolfo Hernandez

Tags: , , , , , , | Posted under Elgg | RSS 2.0

Author Spotlight

Rodolfo Hernandez

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

4 Comments on How to Integrate Google Adsense in Your Elgg Site

  1. pinoy chat says:

    it really works for my website. thanks a lot buddy. i was using spotlight and header before this.

  2. virgilio says:

    Hello, I have elgg 1.8 and i cant find YourElggFolder/views/default/canvas/layouts
    thanks

  3. virgilio says:

    Hi
    I cant see canvas nor widgets.php. maybe bc is elgg 1.8?
    I can only go to
    public_html/mysite/views/default/widgets
    but then i see
    admin_welcome
    content_stats
    control panel, friend, new users, online users, and river
    THANKS

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 9 = 15

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>