How to install Google Analytics to SMF Forum

What is Google Analytics ?

Google Analytics is a webmaster tool for tracking your traffic and give you a lot of your website’s information. For more information, please go to The other convenience thing is you can share your Google Analytic  between google accounts. So you and your friends can both monitor your website.

SMF Forum

SMF Forum is a open source source for creating forum from Simple Machine

The theme source is very complicated so it is difficult to know how to modify and add the Google Analytic code in your theme. So now I will help you how to add to your SMF forum:

Step 1

Get the Google analytic code. I use the new tracking code. It should look like that:

<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src='” + gaJsHost + “’ type=’text/javascript’%3E%3C/script%3E”));
<script type=”text/javascript”>
try {
var pageTracker = _gat._getTracker(“UA-4022109-7”);
} catch(err) {}</script>

or like the Legacy Tracking Code (urchin.js):

<script src=”” type=”text/javascript”>
<script type=”text/javascript”>
try {
_uacct = “UA-4022109-7”;
} catch(err) {}</script>

Step 2

Download Global Headers and Footers mod or easily add code in the code in the header or footer of the theme. It can be done by going to Package section under the Main tab in your admin panel.


Simple way is to fulfill the URL and name of that package into Download a package by url section and click Download button, and Apply that mod.

Step 3: Add the code

Finally, you will be able to see Global Headers and Footers in the Configuration tab. Now you just paste your tracking code in the footer section:


Step 4:Confirm the Google Analytic

You have to confirm google to make sure that everything is going OK by clicking in Edit and Check status button and click check status.


{ 4 comments… add one }
  • Bymnmessine December 18, 2009, 3:56 am

    Your welcome everyone,
    My PC worked slowly, many errors. Please, help me to fix errors on my computer.
    My operation system is Windows7.
    With best regards,

  • ju4ns3 November 3, 2010, 11:59 pm

    Hey Thanks!! the mod is great

  • Alin March 23, 2012, 1:06 am

    thanks, you saved me


Leave a Comment