As you might well know, Statcounter is a Free service to track visitors on your website.
Simply Sign up at www.statcounter.com and start tracking your visitor numbers, referrals and much more.
This way you can also see if your Search Engine Optimization efforts ara paying off..
But there is one Tiny little problem in getting Statcounter running in your Joomla website.. the tracking code is in Java-script which breaks if you use the TinyMCE or even the JCE editor..
How to get the Statcounter Code into Joomla
It is not that hard as you might think, so here is how to do it.
Login to your administration panel and disable the WYSIWYG editor, either global, or just on a user base.
You can do this via the User Manager
Now with the Editors out of the way, you can create an new module to hold the Statcounter Code.
Why and How to use a Module for Statcounter
The main reason for using a Module instead of editing core files, or Templates files is that a module is not Update or Template dependent.
That means if you change template, the Statcounter still works..
If you get an Joomla Update, the Statcounter also will keep working.
Create a new Module
In your administration panel choose Modules and go to site modules
Now create a new Module
Fill in the parameters, and don’t forget the Publish option.
Make sure you get a copy of the Statcounter installation code now:
Got to your Statcounter account and follow the normal procedure to obtain the code.
At the end of the procedure you should have a field with the code you can copy.
This code you need to paste into the new module content section:
Save the module and position it where you see fit, just another nice option of the Module functionality…
Here is my final result…
As you might see, the module has automatically taken over any module layout related settings to fit the template.
How to work with hidden counter
Some people like to have there counter hidden, oké that is also doable.
Make sure you got the code from Statcounter with the option hidden and paste that into the module, just as explained above.
But now, set the Module parameter "Show Title" to "No" , but keep it Published !!
Now if you look at your site, you will see No counter on the page, but it should be in the Source code.
Check if everything works and you get visitor counts on your Statcounter Reports.
Make sure you Block your own visits :-) by using a Blocking Cookie or IP address Blocking in your Settings..
Now forget all about this work and enjoy your Statcounter reports…
P.s. Don’t forget to set the WYSIWYG editor to On again, but once turned on, do not !! edit the module, or it will break….