Logging a Custom Event

The RUISDK.TrackEventCustom function logs a normal event with the supplied data, including an array of custom name/value pairs.

The RUISDK.TrackEventCustom function can be called between RUISDK.StartSDK and RUISDK.StopSDK, and can be called zero or more times.

The RUISDK.TrackEventCustom function 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.

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

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

RUISDK.TrackEventCustom

RUIResult RUISDK.TrackEventCustom (String eventCategory, String eventName, List<RUINameValuePair> customValues, String sessionID = "")

Parameters

The RUISDK.TrackEventCustom function has the following parameters.

RUISDK.TrackEventCustom 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:

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.
ValidationeventCategory can be empty; eventName cannot be empty.

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:

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.
ValidationeventCategory can be empty; eventName cannot be empty.

customValues (List<RUINameValuePair)

A list of name/value String pairs related to this particular event. The RUINameValuePair class has two members:

public String name—Custom data associated with the event. 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 configured on the Server. Both names and values have a default maximum of 128 UTF-8 characters.
public String value—Custom text data associated with the event, cannot be empty. Trimmed to a maximum length determined by the Server. Both names and values have a default maximum of 128 UTF-8 characters.

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 ruiStartSession.

If the application supports only a single session (multiSessionEnabled = false), then this value should be empty.

Returns

The RUISDK.TrackEventCustom function returns a RUIResult enum value with the following possible values.

RUISDK.TrackEventCustom Returns

Return

Description

ok

Synchronous functionality 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.

invalidSessionIDNotActive

The sessionID is not currently in use.

invalidParameterExpectedNonEmpty

Some API parameter is expected to be non-empty, and is not.