mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
* Added mixpanel tracking for bunch of events. * Changed hitEnter action to pinSearch. * Moved all the event tracking out of app-actions.js * Addressed @foot's comment. * Added more keypress events tracking. * Disable 'r' keyboard shortcut when Resource View is disabled
13 lines
344 B
JavaScript
13 lines
344 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.mixpanel && process.env.WEAVE_CLOUD) {
|
|
window.mixpanel.track(name, props);
|
|
} else {
|
|
log('trackMixpanelEvent', name, props);
|
|
}
|
|
}
|