Newsflash

 
Home arrow Buzzword-noncompliant arrow Adding a hit counter or a site statistics tracker to Gallery
Adding a hit counter or a site statistics tracker to Gallery
Programming Blog - Photo blogging / gallery software
Written by Administrator   
Friday, 13 July 2007

I added a statistics tracker (my choice is StatCounter) to my Gallery2 installation. Adding a third-party statistics tracker to a web site involves adding a piece of HTML and Javascript code to every page of the site. For this I needed to know where Gallery2 HTML code is generated. As far as I could tell, each Gallery2 theme contains separate templates for HTML code generation. The templates are .tpl files located in themes/<theme name>/templates directory. The <BODY>...</BODY> tag rests in theme.tpl file. I put the tracking code right before the </BODY> tag. As far as I can see, it didn't break anything. However, since every theme has its own theme.tpl file, this would mean you have to add the tracking code to the theme.tpl file of each theme you use, otherwise the tracker will stop tracking if you change the theme.

I'm sure there are code segments somewhere in the Gallery2 code that are included in each and every Gallery2 page regardless of the theme (like the code that generates those "Validation", "Donate", etc. buttons at the bottom of the page), but I thought it was too much bother to find out where they were produced, especially since I mostly use just one theme anyway.

Last Updated ( Friday, 13 July 2007 )
 
Next >

(C) 2012 Elze's CMS experiment
Joomla! is Free Software released under the GNU/GPL License.