Class: AnalyticsManager

analytics-manager.AnalyticsManager(options)

The main entry point to Mobify's analytics framework. You can use this class to send analytics data to several analytics connectors at the same time.

This class is a composite - when you call track('event', {payload}) on the AnalyticsManager, it will call the track() method on every configured Connector, in turn.

Constructor

new AnalyticsManager(options)

Parameters:
Name Type Description
options Object

Analytics Manager options

Properties
Name Type Description
connectors Array.<AnalyticsConnector>

An array of Connectors to register with the Analytics Manager. These must implement the AnalyticsConnector interface.

debug Boolean

debug mode flag. true will turn the logger on.

Implements:

Methods

load() → {Promise.<undefined>}

Loads necessary resources and performs any additional set up required to create the connection to the Analytics Provider.

Implements:
See:
Returns:

Returns a resolved promise when the resources are fully loaded.

Type
Promise.<undefined>

track()

Validate and transform the analytics event and send it to its analytics connectors.

Implements:

trackPageLoad(initPagePromise) → {Promise}

Record performance metrics from initializing a page.

Parameters:
Name Type Description
initPagePromise Promise

The promise that initializes a page.

Returns:

The response from an initialized page.

Type
Promise