Google Analytics
progressive-web-sdk/dist/analytics-integrations/connectors/google-analytics
The google-analytics
module contains the GoogleAnalyticsConnector
class,
an implementation of the AnalyticsConnector
interface, used for connecting
to Google Analytics.
class
GoogleAnalyticsConnector
Importimport { GoogleAnalyticsConnector } from 'progressive-web-sdk/dist/analytics-integrations/connectors/google-analytics
Implements:
Constructor
Usagenew GoogleAnalyticsConnector(options)
Parameter | Type | Description |
---|---|---|
options | Object | Google Analytics options. |
options.trackerName | String | (required) Google Analytics Tracker name. |
options.trackerId | String | (required) Google Analytics Tracker id. |
options.splitTestConfig | Object | configuration values required to set up split test: clientIdDimension, bucketDimension, bucketValue . |
options.ecommerceLibrary | String | The name of the Google Analytics ecommerce library to load. |
options.gaDebug | Boolean | (default: false) GA debug flag. true will load the ga library that enables debugging. |
Methods
setupSplitTest()
Spit test set up.
Returns:
undefined
loadEcommerceLibrary()
Ecommerce library initialization.
Returns:
undefined
load()
Loads necessary resources and performs any additional set up required to create the connection to the Analytics Provider.
Implements:
Returns:
Promise.<undefined> - Returns a resolved promise when the resources are fully loaded.
See also: loadScript
track(type, data)
Track an analytics event and send it to an analytics provider.
Implements:
Returns:
Object - The data that was sent to the analytics provider.
See also: types
Parameter | Type | Description |
---|---|---|
type | String | The event type, which can be any String, but Mobify has special support for some built-in types. |
data | Object | The event data, which can be any Object, but Mobify has special support for some built-in types. |