Files
weave-scope/client/app/scripts/utils/tracking-utils.js
Damien Lespiau a205f6ecb7 tracking: Rename trackMixpanelEvent() to trackAnalyticsEvent()
Might as well not mention Mixpanel now that we're sending all events to
Segment.

Commit done with:

  git grep trackMixpanelEvent | cut -d : -f 1 | sort -u | \
	xargs sed -e s/trackMixpanelEvent/trackAnalyticsEvent/g
2017-09-25 13:57:00 +01:00

13 lines
348 B
JavaScript

import debug from 'debug';
const log = debug('service:tracking');
// Track mixpanel events only if Scope is running inside of Weave Cloud.
export function trackAnalyticsEvent(name, props) {
if (window.analytics && process.env.WEAVE_CLOUD) {
window.analytics.track(name, props);
} else {
log('trackAnalyticsEvent', name, props);
}
}