Ember Segment
How it works
Addon will add the following code to your router.js
:
// only if segment addon is enabledif configsegment && configsegmentenabled // `gatherPageAnalytics` action will be invoked on // each transition and it can be handled on route/controller level. Router; // to make sure not to break your application // default implementation of `gatherPageAnalytics` // is provided EmberRoute;
How to use
One way to track your application's pages would be to create a parent route:
// base-route.jsRoute; // child-route.js; ;
Segment Service
trackAction
and trackPage
return Promises and do track
and page
accordingly.
Configuration
You can configure the addon through config/enironment.js
by adding segment
object to it.
ENVsegment = // enable/disable analytics enabled: true // api key for reporting writeKey: '';