An extension to facilitate Google Analytics in Adapt.
- Add the following to
config.json
:
"_googleAnalytics": {
"_isEnabled": true,
"_trackingId": ""
}
- Populate
_trackingID
with the tracking ID of your Google Analytics property. - Copy the extension folder into the src > extensions directory and run an appropriate Grunt task.
- Every time a menu or page is loaded, a
pageview
is recorded with a new URL and title. - Pop-up interactions are tracked through custom events e.g. launching Notify, Drawer etc.
- Media plays and percentage viewed are also tracked.
- Additional events can be tracked with
Refer to
Adapt.trigger("googleAnalytics:trackEvent", category, action, label[, value[, isNonInteraction]]);
trackEvent()
in adapt-googleAnalytics.js and Event Tracking for details.
Attribute | Type | Description | Default |
---|---|---|---|
_isEnabled |
Boolean | Enables Google Analytics tracking | false |
_isDebugMode |
Boolean | Displays notifications when pageviews and events are tracked | false |
_trackingId |
String | The tracking ID of the Google Analytics property to track, in the format "UA-XXXXX-Y" |
"" |