How to add adsense to Elgg / Inserting adsense code in Elgg community network

Tuesday, 15th March 2011

To continue further with my recent experiments with the Elgg GLP social network I looked online if Elgg supports Google adsense via some add-on plugin etc.

Pitily there is just one plugin for elgg which enables Google Analytics and Google Adsense support but it costs money 😐

Luckily there is a very easy way to add an adsense code to your elgg installation, it’s manual but it works.
So to add the your adsense banner to your Elgg website, you need to edit the file:

mod/custom_index/views/default/canvas/layouts/new_index.php

The file is located in elgg’s installation document root.

After you have the new_index.php file in some text editor look up for the line:

<!-- latest members -->

The <!– latest members –> should be located on line 85 on elgg 1.7.x, if not it should somewhere nearby;
After can place your adsense code in the following html tags:

<div align="center">
<table border="1">
<tr>
<td>
your adsense code goes here
</tr>
</td>
</table>
</div>

That’s all, the adsense advertisements should appear on your elgg website immediately, if they don’t show up immediately and you are using an adsense code which is just issued via google.com/adsense/ wait for about 10 minutes and the ads should start appearing.

Share this on:

Download PDFDownload PDF

Tags:

One Response to “How to add adsense to Elgg / Inserting adsense code in Elgg community network”

  1. szczegóły dostępne tutaj says:
    Firefox 3.5.3 Firefox 3.5.3 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

    fajowy pomysÅ‚ 🙂 osobiÅ›cie jestem za! Każdy Twój artykuÅ‚ jest przepeÅ‚niony bardzo pozytywnÄ… energiÄ…. LubiÄ™ to!

    View CommentView Comment

Leave a Reply

CommentLuv badge