cgkineo / adapt-googleAnalytics

An extension to facilitate Google Analytics in Adapt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google Analytics

An extension to facilitate Google Analytics in Adapt.

Installation

  • 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.

Usage

  • 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
    Adapt.trigger("googleAnalytics:trackEvent", category, action, label[, value[, isNonInteraction]]);
    Refer to trackEvent() in adapt-googleAnalytics.js and Event Tracking for details.

Attributes

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" ""

About

An extension to facilitate Google Analytics in Adapt

License:GNU General Public License v3.0


Languages

Language:JavaScript 83.7%Language:HTML 12.1%Language:CSS 4.2%