Installing Google Analytics in Mambo

Mambo has a wide variety of plugins, but analyzing its traffic is often best done with a program like Google Analytics.  This allows you to evaluate website traffic in order to help determine the areas of the site which may need improvement.  The following article explains how to add Google Analytics in to your Mambo installation using its back end Administration interface.
 

Setting Up Google Analytics on Mambo

 
Setting up Google Analytics for Mambo is a two-part process. You will need to first create an account for Google Analytics.  Through the account you will obtain the code that is necessary for installing Google Analytics into your Mambo website.  The second part takes Google Analytics code and places it within the index page of your Mambo website using the Mambo Administration back end interface.
 

Get your Google Analytics Tracking Code

  1. Login and/or setup your Google Analytics account for your Mambo website.
  2. Obtain the tracking code snippet.  Usually, this will be immediately presented during the creation of your account.  However, if you need to find it later, you can go to the Account list, select your website, and click on the tab labeled TRACKING INFO.  You will see the Code snippet towards the bottom of the screen.  Leave this window open so that you can reference it when you are in your Mambo interface.  Typically, the code is fairly short and should look something like this:
    <script type=”text/javascript”>

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-1234578-1’]);
    _gaq.push([‘_trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘https://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

    </script>  

Edit the Template Index file

  1. Login to the Mambo Administration back end.
  2. Hover over the SITE menu item, then click on TEMPLATE MANAGER>Site Templates when the drop-down menu appears.  
  3. Select template and edit button

    Click on the radial button for the template that you are using in your Mambo front end, then click on EDIT HTML in the top right hand corner.  You will be editing the INDEX.PHP file of the template.  You can verify this by looking at the file name immediately above the code edit window.

  4.  
  5. Edit Template index.php file

    Find the “</head>” tag within the code, click in the edit window so that your cursor is blinking in front of this tag, then click on your enter key a few times to add an empty space in the code.  

  6.  
  7. Code inserted into Mambo Template index file

    Retrieve the Google Analytics code from the first part of this tutorial.  And paste it into the space you created.  The code should be pasted BEFORE the “</head>” tag.

  8.  
  9. Click on SAVE in the top right hand corner.
 
This completes the installation of the Google Analytics code into your Mambo website.  Remember that you will need traffic going into your website in order to generate records that Google Analytics can track.  If you need more information on using Google Analytics, go to their website on learning to use the application here:  Learn Google Analytics.

AC
Arnel Custodio Content Writer I

As a writer for InMotion Hosting, Arnel has always aimed to share helpful information and provide knowledge that will help solve problems and aid in achieving goals. He's also been active with WordPress local community groups and events since 2004.

More Articles by Arnel

Was this article helpful? Join the conversation!