Class: GoogleAnalytics

GoogleAnalytics()

A model that connects with an analytics service to record user interactions with the app

Constructor

new GoogleAnalytics()

Since:
  • 2.25.0
Source:

Extends

Members

track :function

The main function for sending analytics events to the service.
Type:
  • function
Overrides:
Source:

type :string

The name of this Model
Type:
  • string
Overrides:
Source:

Methods

createExceptionDescription(message, id) → {string}

Given a message and an optional ID, create a description of an exception event that can be sent to an analytics service.
Parameters:
Name Type Description
message string A description of the exception
id string The ID for the associated package or object
Inherited From:
Source:
Returns:
A description of the exception event
Type
string

defaults() → {object}

Default attributes for this model
Inherited From:
Source:
Returns:
Type
object

getKey() → {string}

Get the key for the analytics service. This is the ID that is used to initialize the analytics service.
Overrides:
Source:
Returns:
The key for the analytics service
Type
string

getVersion() → {string}

Get the version number of the MetacatUI app.
Inherited From:
Source:
Returns:
The version number of the MetacatUI app
Type
string

initialize()

Creates a new Analytics model
Inherited From:
Source:

ready() → {boolean}

Check if analytics service is enabled and ready to use.
Overrides:
Source:
Returns:
True if the service is enabled in the app and the track method is available.
Type
boolean

setupAnalytics()

Set up the analytics service.
Overrides:
Source:

trackEvent(category, action, label, value)

Send the details of an event to an analytics service. The function will do nothing if an analytics service is not enabled.
Parameters:
Name Type Description
category string The category of the event
action string The action of the event
label string The label of the event
value string The value of the event
Overrides:
Source:

trackException(message, id, fatal)

Send the details of an exception event to an analytics service. This will automatically include the MetacatUI version number in the event details. The function will do nothing if an analytics service is not enabled.
Parameters:
Name Type Description
message string A description of the exception
id string The ID for the associated package or object
fatal boolean Whether the exception was fatal
Overrides:
Source:

trackPageView(path, title)

Send the details of a page view to an analytics service. The function will do nothing if an analytics service is not enabled.
Parameters:
Name Type Description
path string The path of the page
title string The title of the page
Overrides:
Source: