API Docs for: 3.3.43

Class AnalyticsMonitor

Encapsulating the full API for the analytics monitor. This is the main monitor class and an instance is retrieved by calling the createMonitor method on the AnalyticsMonitorFactory. You should only create a single instance of this class for each specific product that you want to monitor which is typically only a single instance.

Note that this class cannot be instantiated directly but must be created through a call to createMonitor

setInstallationID( installationID )

Assigning the installation id. The installation id can be used to associate the data with a specific identifier. This can be used to e.g. associate all data from a given logic department with the same identifier

Parameters:
  • installationID <String>

    the installation id

setUserID( userID )

Assigning the user id, which is used to identify this unique user. This value must be a GUID and must be set before the monitor is started by calling start(). This value is ONLY used in the case where the monitor cannot rely on cookies to store a persistent identifiation of this user: when cookies has been turned off in the monitor settings (by setting settings.useCookies to false) or if the browser does not allow cookies. In all other cases the UserID provided here will be ignored.

Parameters:
  • userID <String>

    the user id as a GUID

start( )

Starting the monitor. If the monitor is disabled a call to start has no effect.

AnalyticsMonitorStatus status( )

Retrieving the current status of the monitor. Note that the status is a snapshot and is not updated after being returned from this method.


stop( )

Stopping the monitor. Will stop the monitor if already started and attempt to deliver data to the servers as part of stopping

trackException( exception, message )

Tracking an exception instance. This call will attempt to extract general information from the exception. The context message can be passed to give more context to the exception.

Parameters:
  • exception <Error>

    the exception object

  • message <String>

    a context message

trackFeature( featureName )

Tracking a named feature. Tracking a feature will increment the usage of this named feature. Consider using a simple dot-notation to group features that are comparable. In the example below the PDF and HTML report trackings are grouped and are immediately comparable

       ...
       if (usePDF)
       {
       monitor.trackFeature('Report.PDF');
       // generate the PDF report
       }
       else
       {
       monitor.trackFeature('Report.HTML');
       // generate the HTML report
       }
Parameters:
  • featureName <String>

    the feature name

trackFeatureCancel( featureName )

Cancelling an ongoing feature timing. This only has an effect if there has been a previous call to trackFeatureStart with the same name in which case the timing is discarded and reset.

Parameters:
  • featureName <String>

    the feature name

trackFeatureStart( featureName )

Tracking the start of a feature timing. Call this to signal the start of timing for a specific named feature. The timing can later by registered by calling trackFeatureStop or cancelled by calling trackFeatureCancel.

Parameters:
  • featureName <String>

    the feature name

trackFeatureStop( featureName )

Stopping and registering a feature timing. This only has an effect if there has been a previous call to trackFeatureStart with the same feature name in which case the timing is registered.

Parameters:
  • featureName <String>

    the feature name

trackFeatureValue( featureName, featureValue )

Tracking a discrete feature value. Call this to associate a specific discrete value with a named feature.

Parameters:
  • featureName <String>

    the feature name

  • featureValue <Number>

    the feature value