﻿// make that the namespace "NURUN.widget" is created.
NURUN.namespace("SAPUTO");
/**
* @namespace All widgets must be under this namespace 
*/

window.SAPUTO = window.SAPUTO || {};

//Activate this to prevent onclick default behavior on custom tagging
//an allow to view console logging
var GoogleAnalyticsDebugMode=false;

///This object is used to track custom events while avoiding the potential errors
// that would occur when analytics is disabled. This occur in local development environment.
SAPUTO.GoogleAnalytics = function() {
    this.tracker = null;

    this.trackCustomEvents = function(e, trackingInformation) {

        //e = e || event;

        //if analytics is enable, use the Google API method to perform the tracking.
        if (this.tracker != null) {
            //if analytics is disable, trace the call on the firefox console for debugging purposes
            if (GoogleAnalyticsDebugMode) {
                console.info("trackingInformation:", trackingInformation);
            }

            this.tracker._trackPageview(trackingInformation);
        }
        return !GoogleAnalyticsDebugMode;
    };

};
