src/utils/HealthLogger.js
function sendAnalyticsData(eventName, eventCategory, eventSubCategory, eventType, eventSubType) {
        var isEventDataAlreadySent = analyticsEventMap.get(eventName),
            isHDTracking   = PreferencesManager.getExtensionPrefs("healthData").get("healthDataTracking"),
            eventParams = {};

        if (isHDTracking && !isEventDataAlreadySent && eventName && eventCategory) {
            eventParams =  {
                eventName: eventName,
                eventCategory: eventCategory,
                eventSubCategory: eventSubCategory || "",
                eventType: eventType || "",
                eventSubType: eventSubType || ""
            };
            notifyHealthManagerToSendData(eventParams);
        }
    }
function sendAnalyticsData(eventName, eventCategory, eventSubCategory, eventType, eventSubType) {
        var isEventDataAlreadySent = analyticsEventMap.get(eventName),
            isHDTracking   = PreferencesManager.getExtensionPrefs("healthData").get("healthDataTracking"),
            eventParams = {};

        if (isHDTracking && !isEventDataAlreadySent && eventName && eventCategory) {
            eventParams =  {
                eventName: eventName,
                eventCategory: eventCategory,
                eventSubCategory: eventSubCategory || "",
                eventType: eventType || "",
                eventSubType: eventSubType || ""
            };
            notifyHealthManagerToSendData(eventParams);
        }
    }
function sendAnalyticsData ( eventName , eventCategory , eventSubCategory , eventType , eventSubType ) { var isEventDataAlreadySent = analyticsEventMap . get ( eventName ) , isHDTracking = PreferencesManager . getExtensionPrefs ( "healthData" ) . get ( "healthDataTracking" ) , eventParams = { } ; if ( isHDTracking && ! isEventDataAlreadySent && eventName && eventCategory ) { eventParams = { eventName : eventName , eventCategory : eventCategory , eventSubCategory : eventSubCategory || "" , eventType : eventType || "" , eventSubType : eventSubType || "" } ; notifyHealthManagerToSendData ( eventParams ) ; } }
Send Analytics Data
@param {string} eventCategory The kind of Event Category that
needs to be logged- should be a js var compatible string
@param {string} eventSubCategory The kind of Event Sub Category that
needs to be logged- should be a js var compatible string
@param {string} eventType The kind of Event Type that needs to be logged- should be a js var compatible string
@param {string} eventSubType The kind of Event Sub Type that
needs to be logged- should be a js var compatible string
Send Analytics Data