Tracking an Event
The RUISDK.TrackEvent feature enables you keep track of how your clients are interacting with the various features within your application, potentially identifying how often every single feature is being used by various user groups. Apart from monitoring feature usage, you can also keep track of how often an event happens - such as how often an auto save has been made on average for every hour your application was running.
The RUISDK.TrackEvent feature logs a normal event with the supplied data.
RUISDK.TrackEvent can be called between RUISDK.StartSDK and RUISDK.StopSDK, and can be called zero or more times.
RUISDK.TrackEvent can be called while a New Registration is being performed (RUISDK.CreateConfig, RUISDK.StartSDK). However, the event data is not written to the log file until the New Registration completes, and if the New Registration fails, the data will be lost.
RUISDK.TrackEvent is an asynchronous function, returning immediately with further functionality executed on separate thread(s).
RUIResult RUISDK.TrackEvent (String eventCategory, String eventName, String sessionID = “”)
Parameters
The RUISDK.TrackEvent function has the following parameters.
Parameter |
Description |
|||||||||||||||
eventCategory (String) |
The name of the category of this event. This parameter is optional (set to string.Empty or null if not required). Unlike V4 of the Usage Intelligence SDK, there is no concept of extended names (for eventCategory and eventName). The content of eventCategory and eventName is conditioned and validated (after conditioning) with the following rules:
|
|||||||||||||||
eventName (String) |
The name of the event to be tracked. Unlike V4 of the Usage Intelligence SDK, there is no concept of extended names (for eventCategory and eventName). The content of eventCategory and eventName is conditioned and validated (after conditioning) with the following rules:
|
|||||||||||||||
sessionID (String) |
If multiple user sessions are supported within the application (multiSessionEnabled = true), this should contain the unique ID that refers to the user session in which the event occurred. It must be a current valid value used in RUISDK.StartSession. If the application supports only a single session (multiSessionEnabled = false), then this value should be empty. |
Returns
The RUISDK.TrackEvent function returns a RUIResult enum value with the following possible values.
Return |
Description |
ok |
Function successful. |
sdkInternalErrorFatal |
Irrecoverable internal fatal error. No further API calls should be made. |
sdkAborted |
A required New Registration has failed, and hence the SDK is aborted. RUISDK.StopSDK and RUISDK destructor are possible. |
suspended |
Instance has been instructed by Server to back-off. Will return to Running once back-off cleared. |
permanentlyDisabled |
Instance has been instructed by Server to disable. This is permanent, irrecoverable state. |
sdkOptedOut |
Instance has been instructed by the application to opt-out. |
configNotCreated |
Configuration has not been successfully created. |
sdkNotStarted |
SDK has not been successfully started. |
sdkAlreadyStopped |
SDK has already been successfully stopped. |
invalidSessionIDExpectedEmpty |
The sessionID is expected to be empty, and it was not. |
invalidSessionIDExpectedNonEmpty |
The sessionID is expected to be non-empty, and it was not. |
invalidSessionIDTooShort |
The sessionID violates its allowable minimum length. |
invalidSessionIDTooLong |
The sessionID violates its allowable maximum length. |
invalidSessionIDAlreadyActive |
The sessionID is already currently in use. |
invalidParameterExpectedNonEmpty |
Some API parameter is expected to be non-empty, and is not. |