Name

sn_outlook_addin.SNCOutlookAddinUsageAnalytics

Description

Catures Usage analytice using the Analytics Framework API

Script

var SNCOutlookAddinUsageAnalytics = Class.create();
SNCOutlookAddinUsageAnalytics.prototype = {
  type: 'SNCOutlookAddinUsageAnalytics',
  /**
   * Constants
   */
  STREAMID: 'com.sn_outlook_addin',
  EVENTNAME: 'Outlook Addin - Create Incident',
  /**
   * Internal fields
   */
  _debugMode: false,
  /**
   * Internal methods
   */
  _log: function(msg, error) {
      if (this._debugMode || gs.isDebugging()) {
          if (error) {
              gs.error(this.type + '::' + this.STREAMID + '::' + msg, error);
          } else {
              gs.info(this.type + '::' + this.STREAMID + '::' + msg);
          }
      }
  },
  initialize: function(cfg) {
  	// Setup debug mode first
  	this._debugMode = cfg && cfg.debug;
  },
  /**
   * Public methods
   */
  incrementCounter: function(counterMetricId) {
      // for now we will use License Event Tracker framework 
  	// if we need to do further filtering on these events we'll 
  	// switch to the AnalyticsFrameworkAPI
  	try {
  		var eventId = this.STREAMID + '.' + counterMetricId;
  		sn_ua.GlideUAEvent.postEvent(eventId, this.STREAMID, this.EVENTNAME);
  	} catch (e) {
          // Ignore
          this._log('Error sending event', e);
      }
  }
};

Sys ID

a167800de70333005cd96584c2f6a981

Offical Documentation

Official Docs: