Class: Analytics

Class: Analytics

Analytics

Class that provides analytics capabilities. Callers should use MobileBackend's analytics property.
Source:

Methods

endSession() → {Promise.<(Undefined|NetworkResponse)>}

Ends a session if one exists.
Source:
Returns:
Type
Promise.<(Undefined|NetworkResponse)>

flush() → {Promise.<NetworkResponse>}

Uploads all events to the service if the device is online or caches them locally until the device goes online, at which point they will be uploaded. If a session is in progress it will end.
Source:
Returns:
Type
Promise.<NetworkResponse>

getSessionId() → {String}

Returns session ID for current session.
Source:
Returns:
Type
String

logEvent(event) → {AnalyticsEvent}

Writes out an analytics event. It will implicitly call startSession(), which will add a new event to the list of events for Oracle Mobile Cloud Enterprise to consume
Parameters:
Name Type Description
event AnalyticsEvent The event to log.
Source:
Returns:
The AnalyticsEvent instance that was logged.
Type
AnalyticsEvent
Example
event: "GettingStartedJSEvent"

logNamedEvent(name) → {AnalyticsEvent}

Creates a new analytics event with the given name.
Parameters:
Name Type Description
name String The name of the event.
Source:
Returns:
The AnalyticsEvent instance that was logged.
Type
AnalyticsEvent

startSession()

Starts a new session. If one is in progress, then a new session will not be created.
Source: