new Analytics()
Analytics class.
Revieve Analytics module
Methods
addTrackers(trackersInfo, avoidCookies-) → {Boolean}
Method to add trackers to analytics module.
Parameters:
Name | Type | Description |
---|---|---|
trackersInfo |
Array | Array with JSON objects with trackers configuration. |
avoidCookies- |
Boolean | flag for disable cookies for analytics. Each tracker must specify provider, prefix and account. |
Returns:
true if trackers are added successfully
- Type
- Boolean
getTrackers() → {Array}
Method to get active trackers
Returns:
array with the active trackers registered for this instance
- Type
- Array
sendEvent(eventId, value)
Method to send an event to all the trackers registered
Parameters:
Name | Type | Default | Description |
---|---|---|---|
eventId |
String | Id of the event | |
value |
String | null | value to register with event |
setCustomDimensionToGaTracker(trackerIndex, dimensionIndex, value)
Method to add a custom dimension to GA trackers
Parameters:
Name | Type | Description |
---|---|---|
trackerIndex |
Integer | Tracker's index where you want to add the custom dimension |
dimensionIndex |
Integer | index of your custom dimention in your GA configuration |
value |
String | value to the custom dimension |
setCustomMetricToGaTracker(trackerIndex, metricIndex, value)
Method to add a custom metric to GA trackers
Parameters:
Name | Type | Description |
---|---|---|
trackerIndex |
Integer | Tracker's index where you want to add the custom metric |
metricIndex |
Integer | index of your custom metric in your GA configuration |
value |
String | value to the custom metric |