ember-metrics icon indicating copy to clipboard operation
ember-metrics copied to clipboard

Allow configuration of name of Mixpanel page viewed event

Open wireframe opened this issue 8 years ago • 1 comments

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);
  },

wireframe avatar Feb 02 '17 21:02 wireframe

Thanks! Would you like to open a PR for it?

poteto avatar Feb 21 '17 19:02 poteto