Developer Zone

Feature / Event Tracking

Through event tracking, Revulytics Usage Intelligence allows 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. This is accomplished through ruiTrackEvent() .

You may also keep a numeric value, a text value, or a collection of name/value String pairs every time an event is reported. This can be used, for example in the case of ruiTrackEventNumeric(), to keep track of the length of time it took to save a file, or the file size that was saved, etc. These events can be recorded using the functions ruiTrackEventNumeric(), ruiTrackEventText(), and ruiTrackEventCustom() respectively.

Once event-related data has been collected, you will be able to identify trends of the features that are most used during evaluation and whether this trend changes once users switch to a freeware or purchased license or once they update to a different version/product build. You will also be able to compare whether any UI tweaks in a particular version or build number had any effect on exposing a particular feature or whether changes in the actual functionality make a feature more or less popular with users. This tool provides excellent insight for A/B testing whereas you can compare the outcome from different builds to improve the end user experience.

Note: Event Tracking should NOT be used to track the occurrence of exceptions since there is another specific API call for this purpose. If you need to track exceptions, refer to Exception Tracking.


RUIRESULT ruiTrackEvent(RUIINSTANCE* ruiInstance, const char* eventCategory, const char* eventName, const char* sessionID)

Logs a normal event with the supplied data. The usage requirements of the sessionID parameter are the following:

* multiSessionEnabled = false - sessionID must be empty.
* multiSessionEnabled = true  - sessionID must be a current valid value used in ruiStartSession.

NOTE: Unlike V4 of the RUI 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:

* Conditioning: All leading white space is removed.
* Conditioning: All trailing white space is removed.
* Conditioning: All internal white spaces other than space characters (' ') are removed.
* Conditioning: Trimmed to at most 128 UTF-8 characters.
* Validation:   eventCategory can be empty; eventName cannot be empty.

ruiTrackEvent() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.

ruiTrackEvent() can be called while a New Registration is being performed (ruiCreateConfig(), ruiStartSDK()). 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.

ruiTrackEvent() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).

Parameters:

ruiInstance (RUIINSTANCE*) - Pointer to the RUI instance created via ruiCreateInstance()

eventCategory (const char*) - The name of the category that this event forms part of. This parameter is optional (send empty string if not required).

eventName (const char*) - The name of the event to be tracked.

sessionID (const char*) - If multiple user sessions are supported within the application, this should contain the unique
ID that refers to the user session in which the event occurred. If the application supports only a single session, then this value should be empty.
Returns:One of the return status constants below.
* RUI_OK - Synchronous functionality successful.
* RUI_INVALID_SDK_OBJECT - SDK Instance parameter is NULL or invalid.
* RUI_SDK_INTERNAL_ERROR_FATAL - Irrecoverable internal fatal error.  No further API calls should be made.
* RUI_SDK_ABORTED - A required New Registration has failed, and hence the SDK is aborted.  ruiStopSDK and ruiDestroyInstance are possible.
* RUI_SDK_SUSPENDED - The RUI Server has instructed a temporary back-off.
* RUI_SDK_PERMANENTLY_DISABLED - The RUI Server has instructed a permanent disable.
* RUI_SDK_OPTED_OUT - Instance has been instructed by the application to opt-out.
* RUI_CONFIG_NOT_CREATED - Configuration has not been successfully created.
* RUI_SDK_NOT_STARTED - SDK has not been successfully started.
* RUI_SDK_ALREADY_STOPPED - SDK has already been successfully stopped.
* RUI_INVALID_SESSION_ID_EXPECTED_EMPTY - The sessionID is expected to be empty, and it was not.
* RUI_INVALID_SESSION_ID_EXPECTED_NON_EMPTY - The sessionID is expected to be non-empty, and it was not.
* RUI_INVALID_SESSION_ID_TOO_SHORT - The sessionID violates its allowable minimum length.
* RUI_INVALID_SESSION_ID_TOO_LONG - The sessionID violates its allowable maximum length.
* RUI_INVALID_SESSION_ID_NOT_ACTIVE - Parameter validation: The sessionID is not currently in use.
* RUI_INVALID_PARAMETER_EXPECTED_NON_EMPTY - Parameter validation: Some API parameter is expected to be non-empty, and is not.

RUIRESULT ruiTrackEventNumeric(RUIINSTANCE* ruiInstance, const char* eventCategory, const char* eventName, double customValue, const char* sessionID)

Logs a normal event with the supplied data, including a custom numeric field. The usage requirements of the sessionID parameter are the following:

* multiSessionEnabled = false - sessionID must be empty.
* multiSessionEnabled = true  - sessionID must be a current valid value used in startSession.

NOTE: Unlike V4 of the RUI 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:

* Conditioning: All leading white space is removed.
* Conditioning: All trailing white space is removed.
* Conditioning: All internal white spaces other than space characters (' ') are removed.
* Conditioning: Trimmed to at most 128 UTF-8 characters.
* Validation:   eventCategory can be empty; eventName cannot be empty.

ruiTrackEventNumeric() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.

ruiTrackEventNumeric() can be called while a New Registration is being performed (ruiCreateConfig(), ruiStartSDK()). 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.

ruiTrackEventNumeric() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).

Parameters:

ruiInstance (RUIINSTANCE*) - Pointer to the RUI instance created via ruiCreateInstance()

eventCategory (const char*) - The name of the category that this event forms part of. This parameter is optional (send empty string if not required).

eventName (const char*) - The name of the event to be tracked.

customValue (double) - Custom numeric data associated with the event.

sessionID (const char*) - If multiple user sessions are supported within the application, this should contain the unique
ID that refers to the user session in which the event occurred. If the application supports only a single session, then this value should be empty.
Returns:One of the return status constants below.
* RUI_OK - Synchronous functionality successful.
* RUI_INVALID_SDK_OBJECT - SDK Instance parameter is NULL or invalid.
* RUI_SDK_INTERNAL_ERROR_FATAL - Irrecoverable internal fatal error.  No further API calls should be made.
* RUI_SDK_ABORTED - A required New Registration has failed, and hence the SDK is aborted.  ruiStopSDK and ruiDestroyInstance are possible.
* RUI_SDK_SUSPENDED - The RUI Server has instructed a temporary back-off.
* RUI_SDK_PERMANENTLY_DISABLED - The RUI Server has instructed a permanent disable.
* RUI_SDK_OPTED_OUT - Instance has been instructed by the application to opt-out.
* RUI_CONFIG_NOT_CREATED - Configuration has not been successfully created.
* RUI_SDK_NOT_STARTED - SDK has not been successfully started.
* RUI_SDK_ALREADY_STOPPED - SDK has already been successfully stopped.
* RUI_INVALID_SESSION_ID_EXPECTED_EMPTY - The sessionID is expected to be empty, and it was not.
* RUI_INVALID_SESSION_ID_EXPECTED_NON_EMPTY - The sessionID is expected to be non-empty, and it was not.
* RUI_INVALID_SESSION_ID_TOO_SHORT - The sessionID violates its allowable minimum length.
* RUI_INVALID_SESSION_ID_TOO_LONG - The sessionID violates its allowable maximum length.
* RUI_INVALID_SESSION_ID_NOT_ACTIVE - Parameter validation: The sessionID is not currently in use.
* RUI_INVALID_PARAMETER_EXPECTED_NON_EMPTY - Parameter validation: Some API parameter is expected to be non-empty, and is not.

RUIRESULT ruiTrackEventText(RUIINSTANCE* ruiInstance, const char* eventCategory, const char* eventName, const char* customValue, const char* sessionID)

Logs a normal event with the supplied data, including a custom string field. The usage requirements of the sessionID parameter are the following:

* multiSessionEnabled = false - sessionID must be empty.
* multiSessionEnabled = true  - sessionID must be a current valid value used in startSession.

NOTE: Unlike V4 of the RUI 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

* Conditioning: All leading white space is removed.
* Conditioning: All trailing white space is removed.
* Conditioning: All internal white spaces other than space characters (' ') are removed.
* Conditioning: Trimmed to at most 128 UTF-8 characters.
* Validation:   eventCategory can be empty; eventName cannot be empty.

ruiTrackEventText() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.

ruiTrackEventText() can be called while a New Registration is being performed (ruiCreateConfig(), ruiStartSDK()). 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.

ruiTrackEventText() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).

Parameters:

ruiInstance (RUIINSTANCE*) - Pointer to the RUI instance created via ruiCreateInstance()

eventCategory (const char*) - The name of the category that this event forms part of. This parameter is optional (send empty string if not required).

eventName (const char*) - The name of the event to be tracked.

customValue (const char*) - Custom text data associated with the event, cannot be empty. Trimmed to a maximum length determined by the RUI Server. Current default maximum is 4096 UTF-8 characters.

sessionID (const char*) - If multiple user sessions are supported within the application, this should contain the unique
ID that refers to the user session in which the event occurred. If the application supports only a single session, then this value should be empty.
Returns:One of the return status constants below.
* RUI_OK - Synchronous functionality successful.
* RUI_INVALID_SDK_OBJECT - SDK Instance parameter is NULL or invalid.
* RUI_SDK_INTERNAL_ERROR_FATAL - Irrecoverable internal fatal error.  No further API calls should be made.
* RUI_SDK_ABORTED - A required New Registration has failed, and hence the SDK is aborted.  ruiStopSDK and ruiDestroyInstance are possible.
* RUI_SDK_SUSPENDED - The RUI Server has instructed a temporary back-off.
* RUI_SDK_PERMANENTLY_DISABLED - The RUI Server has instructed a permanent disable.
* RUI_SDK_OPTED_OUT - Instance has been instructed by the application to opt-out.
* RUI_CONFIG_NOT_CREATED - Configuration has not been successfully created.
* RUI_SDK_NOT_STARTED - SDK has not been successfully started.
* RUI_SDK_ALREADY_STOPPED - SDK has already been successfully stopped.
* RUI_INVALID_SESSION_ID_EXPECTED_EMPTY - The sessionID is expected to be empty, and it was not.
* RUI_INVALID_SESSION_ID_EXPECTED_NON_EMPTY - The sessionID is expected to be non-empty, and it was not.
* RUI_INVALID_SESSION_ID_TOO_SHORT - The sessionID violates its allowable minimum length.
* RUI_INVALID_SESSION_ID_TOO_LONG - The sessionID violates its allowable maximum length.
* RUI_INVALID_SESSION_ID_NOT_ACTIVE - Parameter validation: The sessionID is not currently in use.
* RUI_INVALID_PARAMETER_EXPECTED_NON_EMPTY - Parameter validation: Some API parameter is expected to be non-empty, and is not.

RUIRESULT ruiTrackEventCustom(RUIINSTANCE* ruiInstance, const char* eventCategory, const char* eventName, RUINAMEVALUEPAIR* customValue, uint32_t numValues, const char* sessionID)

Logs a normal event with the supplied data, including an array of custom name/value pairs. The usage requirements of the sessionID parameter are the following:

* multiSessionEnabled = false - sessionID must be empty.
* multiSessionEnabled = true  - sessionID must be a current valid value used in startSession.

NOTE: Unlike V4 of the RUI 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:

* Conditioning: All leading white space is removed.
* Conditioning: All trailing white space is removed.
* Conditioning: All internal white spaces other than space characters (' ') are removed.
* Conditioning: Trimmed to a maximum of 128 UTF-8 characters.
* Validation: eventCategory can be empty; eventName cannot be empty.

ruiTrackEventCustom() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.

ruiTrackEventCustom() can be called while a New Registration is being performed (ruiCreateConfig(), ruiStartSDK()). 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.

ruiTrackEventCustom() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).

The name/value pairs are supplied in a struct of type RUINAMEVALUEPAIR. The struct contains two fields:

* const char* name;
* const char* value;

NOTE: Custom data will be logged in the format (Key1,Value1)&&(Key2,Value2)…&&(KeyN,ValueN)

Parameters:

ruiInstance (RUIINSTANCE*) - Pointer to the RUI instance created via ruiCreateInstance()

eventCategory (const char*) - The name of the category that this event forms part of. This parameter is optional (send empty string if not required).

eventName (const char*) - The name of the event to be tracked.

customValues (RUINAMEVALUEPAIR*) - Custom data associated with the event, cannot be empty. A given name and/or value can be
empty. A given name cannot contain white space. All names and values are trimmed to a maximum length determined by the RUI Server. Both names and values have a default maximum of 128 UTF-8 characters.

numValues (uint32_t) - The size of the customValues array (i.e., the number of name/value pairs). Cannot be 0.

sessionID (const char*) - If multiple user sessions are supported within the application, this should contain the unique
ID that refers to the user session in which the event occurred. If the application supports only a single session, then this value should be empty.
Returns:One of the return status constants below.
* RUI_OK - Synchronous functionality successful.
* RUI_INVALID_SDK_OBJECT - SDK Instance parameter is NULL or invalid.
* RUI_SDK_INTERNAL_ERROR_FATAL - Irrecoverable internal fatal error.  No further API calls should be made.
* RUI_SDK_ABORTED - A required New Registration has failed, and hence the SDK is aborted.  ruiStopSDK and ruiDestroyInstance are possible.
* RUI_SDK_SUSPENDED - The RUI Server has instructed a temporary back-off.
* RUI_SDK_PERMANENTLY_DISABLED - The RUI Server has instructed a permanent disable.
* RUI_SDK_OPTED_OUT - Instance has been instructed by the application to opt-out.
* RUI_CONFIG_NOT_CREATED - Configuration has not been successfully created.
* RUI_SDK_NOT_STARTED - SDK has not been successfully started.
* RUI_SDK_ALREADY_STOPPED - SDK has already been successfully stopped.
* RUI_INVALID_SESSION_ID_EXPECTED_EMPTY - The sessionID is expected to be empty, and it was not.
* RUI_INVALID_SESSION_ID_EXPECTED_NON_EMPTY - The sessionID is expected to be non-empty, and it was not.
* RUI_INVALID_SESSION_ID_TOO_SHORT - The sessionID violates its allowable minimum length.
* RUI_INVALID_SESSION_ID_TOO_LONG - The sessionID violates its allowable maximum length.
* RUI_INVALID_SESSION_ID_NOT_ACTIVE - Parameter validation: The sessionID is not currently in use.
* RUI_INVALID_PARAMETER_EXPECTED_NON_EMPTY - Parameter validation: Some API parameter is expected to be non-empty, and is not.
* RUI_INVALID_PARAMETER_EXPECTED_NO_WHITESPACE - Some API parameter is expected to be free of white space, and is not.