Files
weave-scope/client/app/scripts/utils/tracking-utils.js
Damien Lespiau 3f6faa5371 tracking: Use segment for tracking
Align scope to the rest of the platform.
2017-09-22 16:51:37 +01:00

13 lines
346 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 trackMixpanelEvent(name, props) {
if (window.analytics && process.env.WEAVE_CLOUD) {
window.analytics.track(name, props);
} else {
log('trackMixpanelEvent', name, props);
}
}