/**
 * (c) by aheadware.com
 */

var app = app || {};
app.util = app.util || {};

app.util.Tracker = (function(){

    var ga = null,
        uaId = null;


    return {
        init : function( uaId )
        {
            if ( window && window.ga && uaId )
            {
                ga = window.ga;
                ga( 'create', uaId, 'auto' );
                ga( 'set', 'anonymizeIp', true );
            }
        },
        trackPageview : function( page )
        {
            try
            {
                if ( page )
                {
                    ga( 'send', 'pageview', page );
                }
            }
            catch ( e )
            {
                // Fail silently
            }
        }
    }

})();