Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const logEvent = (category, action, label) => {
try {
if (label) {
ReactGA.event({
category,
action,
label
});
mixpanel.track(action);
} else {
ReactGA.event({
category,
action
});
mixpanel.track(action);
}
} catch (exception) {
// statements
console.log(exception);
}
};
componentDidMount() {
mixpanel.init('333f6269317ae9b78a29c535e29f00bf')
mixpanel.track("Edit Profile Page");
}
const data = {
...opts,
browserIpAddress: BROWSER_IP_ADDRESS,
dev: IS_DEV_ENV,
source: 'browser',
streamlitVersion: STREAMLIT_VERSION,
}
if (IS_DEV_ENV) {
logAlways(
`${trackUsage ? '' : 'NOT '}Tracking stat datapoint: `,
eventName, data)
}
if (trackUsage !== false) {
mixpanel.track(eventName, data)
}
}
goToHome: (uploadBandwidth) => {
mixpanel.track(MP_USER_SETTING_CHANGE, { setting: 'upload_bandwidth', before: 0, after: uploadBandwidth });
mixpanel.people.set({ upload_bandwidth: uploadBandwidth });
dispatch(setUploadBandwidth(uploadBandwidth));
dispatch(setOnboardingComplete(true));
dispatch(push('/home'));
},
});
private trackUserLogin() {
if (!environment.analytics) {
return;
}
this.angulartics2.eventTrack.next({
action: 'User login',
properties: {category: 'User Actions'},
});
if (environment.mixpanelKey) {
mixpanel.track('User Login');
}
}
.subscribe(([user, limits]) => {
const userIdHash = hashUserId(user.id);
const signUpDate = dateToMonthYear(user.agreementDate);
const serviceLevel: string = limits ? limits.serviceLevel : ServiceLevelType.FREE;
this.setAnalyticsUsername(userIdHash);
this.setAnalyticsDimensions(serviceLevel, signUpDate);
this.configureSentryUserScope(userIdHash);
if (environment.mixpanelKey) {
mixpanel.track('Application Started');
}
});
}
updateMusic(music) {
if (music.length > 0) {
mixpanel.track("Load Music", music[0].fields);
}
this.setState({
loading: false,
music: music
});
}
componentDidMount() {
mixpanel.track(MP_FORTNITE_CLIENT_LOAD, {});
mixpanel.people.set({
open_on_startup: this.props.settings.launchOnStartup,
minimize_on_startup: this.props.settings.minimizeOnStartup,
minimize_to_tray: this.props.settings.minimizeToTray,
upload_bandwidth: this.props.settings.uploadBandwidth,
obs_mode: this.props.settings.pendingExternalOBSCapture,
match_processed_sound: this.props.settings.matchProcessedSound,
notifications_badge: this.props.settings.notificationsBadge,
manual_upload_notifications: this.props.settings.manualUploadNotifications,
auto_upload: this.props.settings.manualCaptureUpload,
});
}
ipcRenderer.on('update-downloaded', () => {
this.props.setUpdateAvailable(true);
mixpanel.track('Update - Downloaded', {
current_version: appVersion,
});
});
ipcRenderer.on('update-not-available', () => {