This is more of a rant than a tutorial, so forgive me if you are searching a solution and this doesn’t help you.
As far as open source web applications go, Elgg is pretty difficult to work with. It’s buggy, there are a lot of compatibility problems, and support from the development team and the community is less than stellar. The application is, however, very powerful, and has many functions that make it the best choice, in my opinion, for an open source social networking web application.
After some difficulty, I got my installation at http://www.fanclubhelper.com up and running. Being afraid to touch it again, for fear I’d open up a can of worms, I didn’t make any modifications for over a year. In that time, however, the site started ranking well in some searches I’m interested in, and it was now time to install Google Analytics, to see how the traffic was doing.
In most open source software applications I’ve used, in order to make changes, such as adding Google Analytics tracking code, you edit the template file. So I went to /mod/template/templates/MyTemplate/pageshell and pasted the Google Analytics code before the closing body tag. In checking the live site, however, the code was not installed.
Since the closing body tag needs to be coming from somewhere, I took a shot in the dark and added the Google Analytics code to the pageshell file of the default template. That worked, but I have no idea why. It also had the side-effect of putting some text over my logo where it wasn’t before. I can only guess that one of the pageshell templates I put was different on the server than my local copy, and I forgot about it during the year of inactivity. Another ELGG mystery that I’d rather not get into. It’s working well enough, so no touchy!!