Class: Analytics

Analytics


new Analytics(settings)

Parameters:
Name Type Description
settings Object

Settings object

Source:

Methods


send(category, action [, label] [, value])

Send event to analytics.

Parameters:
Name Type Argument Description
category String

Category of this event

action String

Action of this event

label String <optional>

Label of this event

value String <optional>

Value of this event

Source:

Class: Analytics

Analytics


new Analytics()

Google Analytics tracking.
Note: This class is protected, use the default instance instead.

Source:
Example
// Add your GA code into `game/config`
analytics: {
  id: 'my-ga-code'
}

// Import the module:engine/analytics module
import analytics from 'engine/analytics';

// Send to the server
analytics.send('category', 'action', 'label', 'value');

Methods


send(category, action [, label] [, value])

Send event to analytics.

Parameters:
Name Type Argument Description
category String

Category of this event

action String

Action of this event

label String <optional>

Label of this event

value String <optional>

Value of this event

Source: