In development...

Installation & Usage


Add the JavaScript library ma-analytics.min.js to your project (download). A full example is given below in index.html and sample-script.js:

File: index.html

<!DOCTYPE html>
        <!-- Analytics library -->
        <script type="text/javascript" src="ma-analytics.min.js"></script>
        <!-- Developer's custom code -->
        <script type="text/javascript" src="sample-script.js"></script>
        <!-- Sample button -->
        <input type="button" id="myButton" value="Click me"></input>

File: sample-script.js

// Initialise the MaAnalytics library
var maa = new MaAnalytics({

// Log an analytics event on a mouse click
var myButton = document.getElementById("myButton");
myButton.addEventListener("click", function(){
    // Variables to be passed as parameters
    var CATEGORY = "routing to location";
    var ACTION = "click";
    var VALUE = 0;
    var LABEL = "This can be used for supplemental information";
    // Log an event to the MaAnalytics service
    maa.trackEvent(CATEGORY, ACTION, VALUE, LABEL);