ember-metrics
ember-metrics copied to clipboard
Allow configuration of name of Mixpanel page viewed event
Instead of hardcoding the event name page viewed
, allow this to be configurable via the ember-metrics configuration object.
example implementation:
trackPage(options = {}) {
const config = get(this, 'config');
let { trackPageEventName } = config;
trackPageEventName = trackPageEventName || 'page viewed';
const event = { event: trackPageEventName };
const mergedOptions = assign(event, options);
this.trackEvent(mergedOptions);
},
Thanks! Would you like to open a PR for it?