Access Keys:
Skip to content (Access Key - 0)
Home (Access Key - 1)
All spaces... (Access Key - 3)
Log in (Access Key - 5)
Sign up (Access Key - 6)
Templating

Mambo Manual is part of the documentation project for the Mambo open source content management system

Toggle Sidebar

Adding Google Analytics Code to your Mambo Template


There are two common methods for adding Google Analytics code to your Mambo site. Some people choose to add the code to a custom module, however it is just as quick to add the code directly to the template. Adding the analytics code directly into the template also provides a small performance advantage over using modules.

A Mambo template has the following basic structure:

PHP code
<html>
 <head>
 </head>
  <body>
  </body>
</html>

All Mambo-specific code goes in between the HTML tags, eg, mosPathWay, mosMainBody, banners, modules etc.

When you sign up for a Google Analytics account, you will be given the tracking code to add to your template's index.php file. Copy and paste the code segment into the bottom of your template's index.php, immediately before the </body> tag.

So, looking at the structure outlined above, your Google Analytics code will be placed right before the closing body tag, eg:

    <script src="http://www.google-analytics.com/urchin.js"      type="text/javascript">
    </script>
    <script type="text/javascript">
      _uacct="UA-xxxx-x";
      urchinTracker();
    </script>
</body>
</html>
Note
  The UA-xxxx-x needs to be replaced by your own account code  
Toggle Sidebar
Space Navigation
Added by Lynne Pope on 28 Dec, 2007 03:33, last edited by Lynne Pope on 19 Sep, 2008 07:40

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license