mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 18:51:17 +00:00
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
13 lines
348 B
JavaScript
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);
|
|
}
|
|
}
|