Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
ref(analytics): centralize all event names (#2272)
virtuacoplenny9b67e796bdaa
diff --git a/conference.js b/conference.jsindex 497e673cfd..78322d241b 100644--- a/conference.js+++ b/conference.js@@ -15,7 +15,21 @@ import UIEvents from './service/UI/UIEvents';import UIUtil from './modules/UI/util/UIUtil';import * as JitsiMeetConferenceEvents from './ConferenceEvents';-import { initAnalytics, sendAnalyticsEvent } from './react/features/analytics';+import {+ CONFERENCE_AUDIO_INITIALLY_MUTED,+ CONFERENCE_SHARING_DESKTOP_START,+ CONFERENCE_SHARING_DESKTOP_STOP,+ CONFERENCE_VIDEO_INITIALLY_MUTED,+ DEVICE_LIST_CHANGED_AUDIO_MUTED,+ DEVICE_LIST_CHANGED_VIDEO_MUTED,+ SELECT_PARTICIPANT_FAILED,+ SETTINGS_CHANGE_DEVICE_AUDIO_OUT,+ SETTINGS_CHANGE_DEVICE_AUDIO_IN,+ SETTINGS_CHANGE_DEVICE_VIDEO,+ STREAM_SWITCH_DELAY,+ initAnalytics,+ sendAnalyticsEvent+} from './react/features/analytics';import EventEmitter from 'events';@@ -724,12 +738,12 @@ export default {.then(([ tracks, con ]) => {tracks.forEach(track => {if (track.isAudioTrack() && this.isLocalAudioMuted()) {- sendAnalyticsEvent('conference.audio.initiallyMuted');+ sendAnalyticsEvent(CONFERENCE_AUDIO_INITIALLY_MUTED);logger.log('Audio mute: initially muted');track.mute();} else if (track.isVideoTrack()&& this.isLocalVideoMuted()) {- sendAnalyticsEvent('conference.video.initiallyMuted');+ sendAnalyticsEvent(CONFERENCE_VIDEO_INITIALLY_MUTED);logger.log('Video mute: initially muted');track.mute();}@@ -1434,8 +1448,7 @@ export default {promise = createLocalTracksF({ devices: [ 'video' ] }).then(([ stream ]) => this.useVideoStream(stream)).then(() => {- sendAnalyticsEvent(- 'conference.sharingDesktop.stop');+ sendAnalyticsEvent(CONFERENCE_SHARING_DESKTOP_STOP);logger.log('switched back to local video');if (!this.localVideo && wasVideoMuted) {return Promise.reject('No local video to be muted!');@@ -1614,7 +1627,7 @@ export default {.then(stream => this.useVideoStream(stream)).then(() => {this.videoSwitchInProgress = false;- sendAnalyticsEvent('conference.sharingDesktop.start');+ sendAnalyticsEvent(CONFERENCE_SHARING_DESKTOP_START);logger.log('sharing local desktop');}).catch(error => {@@ -1910,8 +1923,7 @@ export default {room.selectParticipant(id);} catch (e) {- sendAnalyticsEvent(- 'selectParticipant.failed');+ sendAnalyticsEvent(SELECT_PARTICIPANT_FAILED);reportError(e);}});@@ -2151,7 +2163,7 @@ export default {// Longer delays will be caused by something else and will just// poison the data.if (delay < 2000) {- sendAnalyticsEvent('stream.switch.delay', { value: delay });+ sendAnalyticsEvent(STREAM_SWITCH_DELAY, { value: delay });}});@@ -2178,7 +2190,7 @@ export default {cameraDeviceId => {const videoWasMuted = this.isLocalVideoMuted();- sendAnalyticsEvent('settings.changeDevice.video');+ sendAnalyticsEvent(SETTINGS_CHANGE_DEVICE_VIDEO);createLocalTracksF({devices: [ 'video' ],cameraDeviceId,@@ -2217,8 +2229,7 @@ export default {micDeviceId => {const audioWasMuted = this.isLocalAudioMuted();- sendAnalyticsEvent(- 'settings.changeDevice.audioIn');+ sendAnalyticsEvent(SETTINGS_CHANGE_DEVICE_AUDIO_IN);createLocalTracksF({devices: [ 'audio' ],cameraDeviceId: null,@@ -2248,8 +2259,7 @@ export default {APP.UI.addListener(UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,audioOutputDeviceId => {- sendAnalyticsEvent(- 'settings.changeDevice.audioOut');+ sendAnalyticsEvent(SETTINGS_CHANGE_DEVICE_AUDIO_OUT);APP.settings.setAudioOutputDeviceId(audioOutputDeviceId).then(() => logger.log('changed audio output device')).catch(err => {@@ -2514,7 +2524,7 @@ export default {// If audio was muted before, or we unplugged current device// and selected new one, then mute new audio track.if (audioWasMuted) {- sendAnalyticsEvent('deviceListChanged.audio.muted');+ sendAnalyticsEvent(DEVICE_LIST_CHANGED_AUDIO_MUTED);logger.log('Audio mute: device list changed');muteLocalAudio(true);}@@ -2522,7 +2532,7 @@ export default {// If video was muted before, or we unplugged current device// and selected new one, then mute new video track.if (!this.isSharingScreen && videoWasMuted) {- sendAnalyticsEvent('deviceListChanged.video.muted');+ sendAnalyticsEvent(DEVICE_LIST_CHANGED_VIDEO_MUTED);logger.log('Video mute: device list changed');muteLocalVideo(true);}diff --git a/modules/API/API.js b/modules/API/API.jsindex 753e35ce31..281ab70cce 100644--- a/modules/API/API.js+++ b/modules/API/API.js@@ -2,7 +2,11 @@import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';import { parseJWTFromURLParams } from '../../react/features/base/jwt';-import { sendAnalyticsEvent } from '../../react/features/analytics';+import {+ API_TOGGLE_AUDIO,+ API_TOGGLE_VIDEO,+ sendAnalyticsEvent+} from '../../react/features/analytics';import { getJitsiMeetTransport } from '../transport';import { API_ID } from './constants';@@ -55,12 +59,12 @@ function initCommands() {'display-name':APP.conference.changeLocalDisplayName.bind(APP.conference),'toggle-audio': () => {- sendAnalyticsEvent('api.toggle.audio');+ sendAnalyticsEvent(API_TOGGLE_AUDIO);logger.log('Audio toggle: API command received');APP.conference.toggleAudioMuted(false /* no UI */);},'toggle-video': () => {- sendAnalyticsEvent('api.toggle.video');+ sendAnalyticsEvent(API_TOGGLE_VIDEO);logger.log('Video toggle: API command received');APP.conference.toggleVideoMuted(false /* no UI */);},diff --git a/modules/UI/recording/Recording.js b/modules/UI/recording/Recording.jsindex 081ed442f7..e8aac6f96b 100644--- a/modules/UI/recording/Recording.js+++ b/modules/UI/recording/Recording.js@@ -24,6 +24,10 @@ import {JitsiRecordingStatus} from '../../../react/features/base/lib-jitsi-meet';import {+ RECORDING_CANCELED,+ RECORDING_CLICKED,+ RECORDING_STARTED,+ RECORDING_STOPPED,sendAnalyticsEvent} from '../../../react/features/analytics';import { setToolboxEnabled } from '../../../react/features/toolbox';@@ -467,7 +471,7 @@ const Recording = {return;}- sendAnalyticsEvent('recording.clicked');+ sendAnalyticsEvent(RECORDING_CLICKED);switch (this.currentState) {case JitsiRecordingStatus.ON:case JitsiRecordingStatus.RETRYING:@@ -475,7 +479,7 @@ const Recording = {_showStopRecordingPrompt(this.recordingType).then(() => {this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED);- sendAnalyticsEvent('recording.stopped');+ sendAnalyticsEvent(RECORDING_STOPPED);},() => {}); // eslint-disable-line no-empty-functionbreak;@@ -488,11 +492,11 @@ const Recording = {this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED,{ streamId });- sendAnalyticsEvent('recording.started');+ sendAnalyticsEvent(RECORDING_STARTED);}).catch(reason => {if (reason === APP.UI.messageHandler.CANCEL) {- sendAnalyticsEvent('recording.canceled');+ sendAnalyticsEvent(RECORDING_CANCELED);} else {logger.error(reason);}@@ -502,7 +506,7 @@ const Recording = {this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED,{ token: this.predefinedToken });- sendAnalyticsEvent('recording.started');+ sendAnalyticsEvent(RECORDING_STARTED);return;}@@ -511,11 +515,11 @@ const Recording = {this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED,{ token });- sendAnalyticsEvent('recording.started');+ sendAnalyticsEvent(RECORDING_STARTED);}).catch(reason => {if (reason === APP.UI.messageHandler.CANCEL) {- sendAnalyticsEvent('recording.canceled');+ sendAnalyticsEvent(RECORDING_CANCELED);} else {logger.error(reason);}diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.jsindex 120adc3fed..94c5132a12 100644--- a/modules/UI/shared_video/SharedVideo.js+++ b/modules/UI/shared_video/SharedVideo.js@@ -10,7 +10,17 @@ import VideoLayout from '../videolayout/VideoLayout';import LargeContainer from '../videolayout/LargeContainer';import Filmstrip from '../videolayout/Filmstrip';-import { sendAnalyticsEvent } from '../../../react/features/analytics';+import {+ SHARED_VIDEO_ALREADY_SHARED,+ SHARED_VIDEO_AUDIO_MUTED,+ SHARED_VIDEO_AUDIO_UNMUTED,+ SHARED_VIDEO_CANCELED,+ SHARED_VIDEO_PAUSED,+ SHARED_VIDEO_STARTED,+ SHARED_VIDEO_STOPPED,+ SHARED_VIDEO_VOLUME_CHANGED,+ sendAnalyticsEvent+} from '../../../react/features/analytics';import {participantJoined,participantLeft@@ -85,11 +95,11 @@ export default class SharedVideoManager {url => {this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, url, 'start');- sendAnalyticsEvent('sharedvideo.started');+ sendAnalyticsEvent(SHARED_VIDEO_STARTED);},err => {logger.log('SHARED VIDEO CANCELED', err);- sendAnalyticsEvent('sharedvideo.canceled');+ sendAnalyticsEvent(SHARED_VIDEO_CANCELED);});@@ -109,7 +119,7 @@ export default class SharedVideoManager {}this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop');- sendAnalyticsEvent('sharedvideo.stoped');+ sendAnalyticsEvent(SHARED_VIDEO_STOPPED);},() => {}); // eslint-disable-line no-empty-function} else {@@ -117,7 +127,7 @@ export default class SharedVideoManager {descriptionKey: 'dialog.alreadySharedVideoMsg',titleKey: 'dialog.alreadySharedVideoTitle'});- sendAnalyticsEvent('sharedvideo.alreadyshared');+ sendAnalyticsEvent(SHARED_VIDEO_ALREADY_SHARED);}}@@ -226,7 +236,7 @@ export default class SharedVideoManager {// eslint-disable-next-line eqeqeq} else if (event.data == YT.PlayerState.PAUSED) {self.smartAudioUnmute();- sendAnalyticsEvent('sharedvideo.paused');+ sendAnalyticsEvent(SHARED_VIDEO_PAUSED);}// eslint-disable-next-line eqeqeqself.fireSharedVideoEvent(event.data == YT.PlayerState.PAUSED);@@ -258,7 +268,7 @@ export default class SharedVideoManager {} else if (event.data.volume <= 0 || event.data.muted) {self.smartAudioUnmute();}- sendAnalyticsEvent('sharedvideo.volumechanged');+ sendAnalyticsEvent(SHARED_VIDEO_VOLUME_CHANGED);};window.onPlayerReady = function(event) {@@ -564,7 +574,7 @@ export default class SharedVideoManager {if (APP.conference.isLocalAudioMuted()&& !this.mutedWithUserInteraction&& !this.isSharedVideoVolumeOn()) {- sendAnalyticsEvent('sharedvideo.audio.unmuted');+ sendAnalyticsEvent(SHARED_VIDEO_AUDIO_UNMUTED);logger.log('Shared video: audio unmuted');this.emitter.emit(UIEvents.AUDIO_MUTED, false, false);this.showMicMutedPopup(false);@@ -578,7 +588,7 @@ export default class SharedVideoManager {smartAudioMute() {if (!APP.conference.isLocalAudioMuted()&& this.isSharedVideoVolumeOn()) {- sendAnalyticsEvent('sharedvideo.audio.muted');+ sendAnalyticsEvent(SHARED_VIDEO_AUDIO_MUTED);logger.log('Shared video: audio muted');this.emitter.emit(UIEvents.AUDIO_MUTED, true, false);this.showMicMutedPopup(true);diff --git a/modules/UI/side_pannels/profile/Profile.js b/modules/UI/side_pannels/profile/Profile.jsindex bad236d78d..b9b3bdd82e 100644--- a/modules/UI/side_pannels/profile/Profile.js+++ b/modules/UI/side_pannels/profile/Profile.js@@ -3,7 +3,11 @@ import UIUtil from '../../util/UIUtil';import UIEvents from '../../../../service/UI/UIEvents';import Settings from '../../../settings/Settings';-import { sendAnalyticsEvent } from '../../../../react/features/analytics';+import {+ AUTHENTICATE_LOGIN_CLICKED,+ AUTHENTICATE_LOGOUT_CLICKED,+ sendAnalyticsEvent+} from '../../../../react/features/analytics';const sidePanelsContainerId = 'sideToolbarContainer';const htmlStr = `@@ -91,7 +95,7 @@ export default {**/function loginClicked() {- sendAnalyticsEvent('authenticate.login.clicked');+ sendAnalyticsEvent(AUTHENTICATE_LOGIN_CLICKED);emitter.emit(UIEvents.AUTH_CLICKED);}@@ -104,7 +108,7 @@ export default {const titleKey = 'dialog.logoutTitle';const msgKey = 'dialog.logoutQuestion';- sendAnalyticsEvent('authenticate.logout.clicked');+ sendAnalyticsEvent(AUTHENTICATE_LOGOUT_CLICKED);// Ask for confirmationAPP.UI.messageHandler.openTwoButtonDialog({diff --git a/modules/UI/videolayout/Filmstrip.js b/modules/UI/videolayout/Filmstrip.jsindex 403eb33de1..de4a9c988b 100644--- a/modules/UI/videolayout/Filmstrip.js+++ b/modules/UI/videolayout/Filmstrip.js@@ -5,7 +5,10 @@ import { setFilmstripVisibility } from '../../../react/features/filmstrip';import UIEvents from '../../../service/UI/UIEvents';import UIUtil from '../util/UIUtil';-import { sendAnalyticsEvent } from '../../../react/features/analytics';+import {+ TOOLBAR_FILMSTRIP_TOGGLED,+ sendAnalyticsEvent+} from '../../../react/features/analytics';const Filmstrip = {/**@@ -150,7 +153,7 @@ const Filmstrip = {return;}if (sendAnalytics) {- sendAnalyticsEvent('toolbar.filmstrip.toggled');+ sendAnalyticsEvent(TOOLBAR_FILMSTRIP_TOGGLED);}this.filmstrip.toggleClass('hidden');diff --git a/modules/keyboardshortcut/keyboardshortcut.js b/modules/keyboardshortcut/keyboardshortcut.jsindex 59665a8cde..09472da877 100644--- a/modules/keyboardshortcut/keyboardshortcut.js+++ b/modules/keyboardshortcut/keyboardshortcut.js@@ -1,7 +1,13 @@/* global APP, $, interfaceConfig */import { toggleDialog } from '../../react/features/base/dialog';-import { sendAnalyticsEvent } from '../../react/features/analytics';+import {+ SHORTCUT_HELP,+ SHORTCUT_SPEAKER_STATS_CLICKED,+ SHORTCUT_TALK_CLICKED,+ SHORTCUT_TALK_RELEASED,+ sendAnalyticsEvent+} from '../../react/features/analytics';import { KeyboardShortcutsDialog }from '../../react/features/keyboard-shortcuts';import { SpeakerStats } from '../../react/features/speaker-stats';@@ -66,7 +72,7 @@ const KeyboardShortcut = {|| $(':focus').is('textarea'))) {if (this._getKeyboardKey(e).toUpperCase() === ' ') {if (APP.conference.isLocalAudioMuted()) {- sendAnalyticsEvent('shortcut.talk.released');+ sendAnalyticsEvent(SHORTCUT_TALK_RELEASED);logger.log('Talk shortcut released');APP.conference.muteAudio(false);}@@ -169,7 +175,7 @@ const KeyboardShortcut = {*/_initGlobalShortcuts() {this.registerShortcut('?', null, () => {- sendAnalyticsEvent('shortcut.shortcut.help');+ sendAnalyticsEvent(SHORTCUT_HELP);APP.store.dispatch(toggleDialog(KeyboardShortcutsDialog, {shortcutDescriptions: _shortcutsHelp}));@@ -178,7 +184,7 @@ const KeyboardShortcut = {// register SPACE shortcut in two steps to insure visibility of help// messagethis.registerShortcut(' ', null, () => {- sendAnalyticsEvent('shortcut.talk.clicked');+ sendAnalyticsEvent(SHORTCUT_TALK_CLICKED);logger.log('Talk shortcut pressed');APP.conference.muteAudio(true);});@@ -186,7 +192,7 @@ const KeyboardShortcut = {if (!interfaceConfig.filmStripOnly) {this.registerShortcut('T', null, () => {- sendAnalyticsEvent('shortcut.speakerStats.clicked');+ sendAnalyticsEvent(SHORTCUT_SPEAKER_STATS_CLICKED);APP.store.dispatch(toggleDialog(SpeakerStats, {conference: APP.conference}));diff --git a/react/features/analytics/AnalyticsEvents.js b/react/features/analytics/AnalyticsEvents.jsnew file mode 100644index 0000000000..d6e6dc660c--- /dev/null+++ b/react/features/analytics/AnalyticsEvents.js@@ -0,0 +1,663 @@+/**+ * The target of a pin or unpin event was the local participant.+ *+ * Known full event names:+ * pinned.local+ * unpinned.local+ *+ * @type {String}+ */+export const _LOCAL = 'local';++/**+ * The target of a pin or unpin event was a remote participant.+ *+ * Known full event names:+ * pinned.remote+ * unpinned.remote+ *+ * @type {String}+ */+export const _REMOTE = 'remote';++/**+ * Audio mute toggled was triggered through the jitsi-meet api.+ *+ * @type {String}+ */+export const API_TOGGLE_AUDIO = 'api.toggle.audio';++/**+ * Video mute toggling was triggered through the jitsi-meet api.+ *+ * @type {String}+ */+export const API_TOGGLE_VIDEO = 'api.toggle.video';++/**+ * Audio only mode has been turned off.+ *+ * @type {String}+ */+export const AUDIO_ONLY_DISABLED = 'audioonly.disabled';++/**+ * The login button in the profile pane was clicked.+ *+ * @type {String}+ */+export const AUTHENTICATE_LOGIN_CLICKED = 'authenticate.login.clicked';++/**+ * The logout button in the profile pane was clicked.+ *+ * @type {String}+ */+export const AUTHENTICATE_LOGOUT_CLICKED = 'authenticate.logout.clicked';++/**+ * Performing a mute or unmute event based on a callkit setMuted event.+ *+ * Known full event names:+ * callkit.audio.muted+ * callkit.audio.unmuted+ *+ * @type {String}+ */+export const CALLKIT_AUDIO_ = 'callkit.audio';++/**+ * Toggling remote and local video display when entering or exiting backgrounded+ * app state.+ *+ * @type {String}+ */+export const CALLKIT_BACKGROUND_VIDEO_MUTED = 'callkit.background.video.muted';++/**+ * The local participant joined audio muted.+ *+ * @type {String}+ */+export const CONFERENCE_AUDIO_INITIALLY_MUTED+ = 'conference.audio.initiallyMuted';++/**+ * The local participant has started desktop sharing.+ *+ * @type {String}+ */+export const CONFERENCE_SHARING_DESKTOP_START+ = 'conference.sharingDesktop.start';++/**+ * The local participant was desktop sharing but has stopped.+ *+ * @type {String}+ */+export const CONFERENCE_SHARING_DESKTOP_STOP+ = 'conference.sharingDesktop.stop';++/**+ * The local participant joined video muted.+ *+ * @type {String}+ */+export const CONFERENCE_VIDEO_INITIALLY_MUTED+ = 'conference.video.initiallyMuted';++/**+ * The list of known input/output devices was changed and new audio input has+ * been used and should start as muted.+ *+ * @type {String}+ */+export const DEVICE_LIST_CHANGED_AUDIO_MUTED = 'deviceListChanged.audio.muted';++/**+ * The list of known devices was changed and new video input has been used+ * and should start as muted.+ *+ * @type {String}+ */+export const DEVICE_LIST_CHANGED_VIDEO_MUTED = 'deviceListChanged.video.muted';++/**+ * The feedback dialog is displayed.+ *+ * @type {String}+ */+export const FEEDBACK_OPEN = 'feedback.open';++/**+ * Page reload overlay has been displayed.+ *+ * Properties: label: reason for reload+ *+ * @type {String}+ */+export const PAGE_RELOAD = 'page.reload';++/**+ * The local participant has pinned a participant to remain on large video.+ *+ * Known full event names:+ * pinned.local+ * pinned.remote+ *+ * @type {String}+ */+export const PINNED_ = 'pinned';++/**+ * Recording start was attempted but the local user canceled the request.+ *+ * @type {String}+ */+export const RECORDING_CANCELED = 'recording.canceled';++/**+ * Recording button has been clicked.+ *+ * @type {String}+ */+export const RECORDING_CLICKED = 'recording.clicked';++/**+ * Recording has been started.+ *+ * @type {String}+ */+export const RECORDING_STARTED = 'recording.started';++/**+ * Recording has been stopped by clicking the recording button.+ *+ * @type {String}+ */+export const RECORDING_STOPPED = 'recording.stopped';++/**+ * Clicked on the button to kick a remote participant from the conference.+ *+ * Properties: value: 1, label: participantID+ *+ * @type {String}+ */+export const REMOTE_VIDEO_MENU_KICK = 'remotevideomenu.kick';++/**+ * Clicked on the button to audio mute a remote participant.+ *+ * Properties: value: 1, label: participantID+ *+ * @type {String}+ */+export const REMOTE_VIDEO_MENU_MUTE_CLICKED = 'remotevideomenu.mute.clicked';++/**+ * Confirmed the muting of a remote participant.+ *+ * Properties: value: 1, label: participantID+ *+ * @type {String}+ */+export const REMOTE_VIDEO_MENU_MUTE_CONFIRMED+ = 'remotevideomenu.mute.confirmed';++/**+ * Clicked on the remote control option in the remote menu.+ *+ * Properties: value: 1, label: participantID+ *+ * Known full event names:+ * remotevideomenu.remotecontrol.stop+ * remotevideomenu.remotecontrol.start+ *+ * @type {String}+ */+export const REMOTE_VIDEO_MENU_REMOTE_CONTROL_+ = 'remotevideomenu.remotecontrol';++/**+ * Replacing the currently used track of specified type with a new track of the+ * same type. The event is fired when changing devices.+ *+ * Known full event names:+ * replacetrack.audio+ * replacetrack.video+ *+ * @type {String}+ */+export const REPLACE_TRACK_ = 'replacetrack';++/**+ * The local participant failed to start receiving high quality video from+ * a remote participant, which is usually initiated by the remote participant+ * being put on large video.+ *+ * @type {String}+ */+export const SELECT_PARTICIPANT_FAILED = 'selectParticipant.failed';++/**+ * The local participant began using a different audio input device (mic).+ *+ * @type {String}+ */+export const SETTINGS_CHANGE_DEVICE_AUDIO_IN = 'settings.changeDevice.audioIn';++/**+ * The local participant began using a different audio output device (speaker).+ *+ * @type {String}+ */+export const SETTINGS_CHANGE_DEVICE_AUDIO_OUT+ = 'settings.changeDevice.audioOut';++/**+ * The local participant began using a different camera.+ *+ * @type {String}+ */+export const SETTINGS_CHANGE_DEVICE_VIDEO = 'settings.changeDevice.video';++/**+ * Attempted to start sharing a YouTube video but one is already being shared.+ *+ * @type {String}+ */+export const SHARED_VIDEO_ALREADY_SHARED = 'sharedvideo.alreadyshared';++/**+ * The local participant's mic was muted automatically during a shared video.+ *+ * @type {String}+ */+export const SHARED_VIDEO_AUDIO_MUTED = 'sharedvideo.audio.muted';++/**+ * The local participant's mic was unmuted automatically during a shared video.+ *+ * @type {String}+ */+export const SHARED_VIDEO_AUDIO_UNMUTED = 'sharedvideo.audio.unmuted';++/**+ * Canceled the prompt to enter a YouTube video to share.+ *+ * @type {String}+ */+export const SHARED_VIDEO_CANCELED = 'sharedvideo.canceled';++/**+ * The shared YouTube video has been paused.+ *+ * @type {String}+ */+export const SHARED_VIDEO_PAUSED = 'sharedvideo.paused';++/**+ * Started sharing a YouTube video.+ *+ * @type {String}+ */+export const SHARED_VIDEO_STARTED = 'sharedvideo.started';++/**+ * Confirmed stoppage of the shared YouTube video.+ *+ * @type {String}+ */+export const SHARED_VIDEO_STOPPED = 'sharedvideo.stoped';++/**+ * The shared YouTube video had its volume change.+ *+ * @type {String}+ */+export const SHARED_VIDEO_VOLUME_CHANGED = 'sharedvideo.volumechanged';++/**+ * Pressed the keyboard shortcut for toggling audio mute.+ *+ * @type {String}+ */+export const SHORTCUT_AUDIO_MUTE_TOGGLED = 'shortcut.audiomute.toggled';++/**+ * Pressed the keyboard shortcut for toggling chat panel display.+ *+ * @type {String}+ */+export const SHORTCUT_CHAT_TOGGLED = 'shortcut.chat.toggled';++/**+ * Toggled the display of the keyboard shortcuts help dialog.+ *+ * @type {String}+ */+export const SHORTCUT_HELP = 'shortcut.shortcut.help';++/**+ * Pressed the keyboard shortcut for togglgin raise hand status.+ *+ * @type {String}+ */+export const SHORTCUT_RAISE_HAND_CLICKED = 'shortcut.raisehand.clicked';++/**+ * Pressed the keyboard shortcut for toggling screenshare.+ *+ * @type {String}+ */+export const SHORTCUT_SCREEN_TOGGLED = 'shortcut.screen.toggled';++/**+ * Toggled the display of the speaker stats dialog.+ *+ * @type {String}+ */+export const SHORTCUT_SPEAKER_STATS_CLICKED = 'shortcut.speakerStats.clicked';++/**+ * Started pressing the key that undoes audio mute while the key is pressed.+ *+ * @type {String}+ */+export const SHORTCUT_TALK_CLICKED = 'shortcut.talk.clicked';++/**+ * Released the key used to talk while audio muted, returning to the audio muted+ * state.+ *+ * @type {String}+ */+export const SHORTCUT_TALK_RELEASED = 'shortcut.talk.released';++/**+ * Toggling video mute state using a keyboard shortcut.+ *+ * @type {String}+ */+export const SHORTCUT_VIDEO_MUTE_TOGGLED = 'shortcut.videomute.toggled';++/**+ * The config specifies the local participant should start with audio only mode+ * enabled or disabled.+ *+ * Known full event names:+ * startaudioonly.enabled+ * startaudioonly.disabled+ *+ * @type {String}+ */+export const START_AUDIO_ONLY_ = 'startaudioonly';++/**+ * The config specifies the local participant should start with audio mute+ * enabled or disabled.+ *+ * Known full event names:+ * startmuted.client.audio.muted+ * startmuted.client.audio.unmuted+ *+ * @type {String}+ */+export const START_MUTED_CLIENT_AUDIO_ = 'startmuted.client.audio';++/**+ * The config specifies the local participant should start with video mute+ * enabled or disabled.+ *+ * Known full event names:+ * startmuted.client.video.muted+ * startmuted.client.video.unmuted+ *+ * @type {String}+ */+export const START_MUTED_CLIENT_VIDEO_ = 'startmuted.client.video';++/**+ * The local participant has received an event from the server stating to+ * start audio muted or unmuted.+ *+ * Known full event names:+ * startmuted.server.audio.muted+ * startmuted.server.audio.unmuted+ *+ * @type {String}+ */+export const START_MUTED_SERVER_AUDIO_ = 'startmuted.server.audio';++/**+ * The local participant has received an event from the server stating to+ * start video muted or unmuted.+ *+ * Known full event names:+ * startmuted.server.video.muted+ * startmuted.server.video.unmuted+ *+ * @type {String}+ */+export const START_MUTED_SERVER_VIDEO_ = 'startmuted.server.video';++/**+ * How long it took to switch between simulcast streams.+ *+ * Properties: value+ *+ * @type {String}+ */+export const STREAM_SWITCH_DELAY = 'stream.switch.delay';++/**+ * Automatically changing the mute state of a media track in order to match+ * the current stored state in redux.+ *+ * Known full event names:+ * synctrackstate.audio.muted+ * synctrackstate.audio.unmuted+ * synctrackstate.video.muted+ * synctrackstate.video.unmuted+ *+ * @type {String}+ */+export const SYNC_TRACK_STATE_ = 'synctrackstate';++/**+ * Clicked the toolbar button to enter audio mute state.+ *+ * @type {String}+ */+export const TOOLBAR_AUDIO_MUTED = 'toolbar.audio.muted';++/**+ * Clicked within a toolbar menu to enable audio only.+ *+ * @type {String}+ */+export const TOOLBAR_AUDIO_ONLY_ENABLED = 'toolbar.audioonly.enabled';++/**+ * Clicked the toolbar button to exit audio mute state.+ *+ * @type {String}+ */+export const TOOLBAR_AUDIO_UNMUTED = 'toolbar.audio.unmuted';++/**+ * Clicked the toolbar button for toggling chat panel display.+ *+ * @type {String}+ */+export const TOOLBAR_CHAT_TOGGLED = 'toolbar.chat.toggled';++/**+ * Clicked the toolbar button for toggling contact list panel display.+ *+ * @type {String}+ */+export const TOOLBAR_CONTACTS_TOGGLED = 'toolbar.contacts.toggled';++/**+ * Clicked the toolbar button to toggle display of etherpad (collaborative+ * document writing).+ *+ * @type {String}+ */+export const TOOLBAR_ETHERPACK_CLICKED = 'toolbar.etherpad.clicked';++/**+ * Pressed the keyboard shortcut to open the device selection window while in+ * filmstrip only mode.+ *+ * @type {String}+ */+export const TOOLBAR_FILMSTRIP_ONLY_DEVICE_SELECTION_TOGGLED+ = 'toolbar.fodeviceselection.toggled';++/**+ * Visibility of the filmstrip has been toggled.+ *+ * @type {String}+ */+export const TOOLBAR_FILMSTRIP_TOGGLED = 'toolbar.filmstrip.toggled';++/**+ * Clicked the toolbar button to toggle display full screen mode.+ *+ * @type {String}+ */+export const TOOLBAR_FULLSCREEN_ENABLED = 'toolbar.fullscreen.enabled';++/**+ * Clicked the toolbar button to leave the conference.+ *+ * @type {String}+ */+export const TOOLBAR_HANGUP = 'toolbar.hangup';++/**+ * Clicked the toolbar button to open the invite dialog.+ *+ * @type {String}+ */+export const TOOLBAR_INVITE_CLICKED = 'toolbar.invite.clicked';++/**+ * The invite dialog has been dismissed.+ *+ * @type {String}+ */+export const TOOLBAR_INVITE_CLOSE = 'toolbar.invite.close';++/**+ * Clicked the toolbar button for toggling the display of the profile panel.+ *+ * @type {String}+ */+export const TOOLBAR_PROFILE_TOGGLED = 'toolbar.profile.toggled';++/**+ * Clicked the toolbar button for toggling raise hand status.+ *+ * @type {String}+ */+export const TOOLBAR_RAISE_HAND_CLICKED = 'toolbar.raiseHand.clicked';++/**+ * Clicked the toolbar button to stop screensharing.+ *+ * @type {String}+ */+export const TOOLBAR_SCREEN_DISABLED = 'toolbar.screen.disabled';++/**+ * Clicked the toolbar button to start screensharing.+ *+ * @type {String}+ */+export const TOOLBAR_SCREEN_ENABLED = 'toolbar.screen.enabled';++/**+ * Clicked the toolbar button for toggling display of the settings menu.+ *+ * @type {String}+ */+export const TOOLBAR_SETTINGS_TOGGLED = 'toolbar.settings.toggled';++/**+ * Clicked the toolbar button for toggling a shared YouTube video.+ *+ * @type {String}+ */+export const TOOLBAR_SHARED_VIDEO_CLICKED = 'toolbar.sharedvideo.clicked';++/**+ * Clicked the toolbar button to open the dial-out feature.+ *+ * @type {String}+ */+export const TOOLBAR_SIP_DIALPAD_CLICKED = 'toolbar.sip.dialpad.clicked';++/**+ * In the mobile app, clicked on the toolbar button to toggle video mute.+ *+ * Known full event names:+ * toolbar.video.muted+ * toolbar.video.unmuted+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_ = 'toolbar.video';++/**+ * Clicked on the toolbar to video unmute.+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_DISABLED = 'toolbar.video.disabled';++/**+ * Clicked on the toolbar to video mute.+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_ENABLED = 'toolbar.video.enabled';++/**+ * Clicked within a toolbar menu to set max incoming video quality to high+ * definition.+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_QUALITY_HIGH = 'toolbar.videoquality.high';++/**+ * Clicked within a toolbar menu to set max incoming video quality to low+ * definition.+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_QUALITY_LOW = 'toolbar.videoquality.low';++/**+ * Clicked within a toolbar menu to set max incoming video quality to standard+ * definition.+ *+ * @type {String}+ */+export const TOOLBAR_VIDEO_QUALITY_STANDARD = 'toolbar.videoquality.standard';++/**+ * The local participant has unpinned a participant so the participant doesn't+ * remain permanently on local large video.+ *+ * Known full event names:+ * unpinned.local+ * unpinned.remote+ *+ * @type {String}+ */+export const UNPINNED_ = 'unpinned';diff --git a/react/features/analytics/index.js b/react/features/analytics/index.jsindex e975ed0e86..5e75d766ec 100644--- a/react/features/analytics/index.js+++ b/react/features/analytics/index.js@@ -1,3 +1,4 @@+export * from './AnalyticsEvents';export * from './functions';import './middleware';diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.jsindex 08d27d2858..6bd9d723b6 100644--- a/react/features/base/conference/actions.js+++ b/react/features/base/conference/actions.js@@ -2,7 +2,11 @@import UIEvents from '../../../../service/UI/UIEvents';-import { sendAnalyticsEvent } from '../../analytics';+import {+ START_MUTED_SERVER_AUDIO_,+ START_MUTED_SERVER_VIDEO_,+ sendAnalyticsEvent+} from '../../analytics';import { getName } from '../../app';import { JitsiConferenceEvents } from '../lib-jitsi-meet';import { setAudioMuted, setVideoMuted } from '../media';@@ -85,9 +89,11 @@ function _addConferenceListeners(conference, dispatch) {const videoMuted = Boolean(conference.startVideoMuted);sendAnalyticsEvent(- `startmuted.server.audio.${audioMuted ? 'muted' : 'unmuted'}`);+ `${START_MUTED_SERVER_AUDIO_}.${+ audioMuted ? 'muted' : 'unmuted'}`);sendAnalyticsEvent(- `startmuted.server.video.${videoMuted ? 'muted' : 'unmuted'}`);+ `${START_MUTED_SERVER_VIDEO_}.${+ videoMuted ? 'muted' : 'unmuted'}`);logger.log(`Start muted: ${audioMuted ? 'audio, ' : ''}${videoMuted ? 'video' : ''}`);diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.jsindex 23b137a40a..f401a22e13 100644--- a/react/features/base/conference/middleware.js+++ b/react/features/base/conference/middleware.js@@ -2,7 +2,14 @@import UIEvents from '../../../../service/UI/UIEvents';-import { sendAnalyticsEvent } from '../../analytics';+import {+ _LOCAL,+ _REMOTE,+ AUDIO_ONLY_DISABLED,+ PINNED_,+ UNPINNED_,+ sendAnalyticsEvent+} from '../../analytics';import { CONNECTION_ESTABLISHED } from '../connection';import { setVideoMuted, VIDEO_MUTISM_AUTHORITY } from '../media';import {@@ -124,7 +131,7 @@ function _conferenceFailedOrLeft({ dispatch, getState }, next, action) {const result = next(action);if (getState()['features/base/conference'].audioOnly) {- sendAnalyticsEvent('audioonly.disabled');+ sendAnalyticsEvent(AUDIO_ONLY_DISABLED);logger.log('Audio only disabled');dispatch(setAudioOnly(false));}@@ -186,14 +193,14 @@ function _pinParticipant(store, next, action) {if (typeof APP !== 'undefined') {const pinnedParticipant = getPinnedParticipant(participants);- const actionName = action.participant.id ? 'pinned' : 'unpinned';+ const actionName = action.participant.id ? PINNED_ : UNPINNED_;let videoType;if ((participantById && participantById.local)|| (!id && pinnedParticipant && pinnedParticipant.local)) {- videoType = 'local';+ videoType = _LOCAL;} else {- videoType = 'remote';+ videoType = _REMOTE;}sendAnalyticsEvent(diff --git a/react/features/base/media/middleware.js b/react/features/base/media/middleware.jsindex a77e3685c2..6001ce3828 100644--- a/react/features/base/media/middleware.js+++ b/react/features/base/media/middleware.js@@ -1,6 +1,12 @@/* @flow */-import { sendAnalyticsEvent } from '../../analytics';+import {+ START_AUDIO_ONLY_,+ START_MUTED_CLIENT_AUDIO_,+ START_MUTED_CLIENT_VIDEO_,+ SYNC_TRACK_STATE_,+ sendAnalyticsEvent+} from '../../analytics';import { SET_ROOM, setAudioOnly } from '../conference';import { parseURLParams } from '../config';import JitsiMeetJS from '../lib-jitsi-meet';@@ -87,9 +93,9 @@ function _setRoom({ dispatch, getState }, next, action) {// Apply the config.sendAnalyticsEvent(- `startmuted.client.audio.${audioMuted ? 'muted' : 'unmuted'}`);+ `${START_MUTED_CLIENT_AUDIO_}.${audioMuted ? 'muted' : 'unmuted'}`);sendAnalyticsEvent(- `startmuted.client.video.${videoMuted ? 'muted' : 'unmuted'}`);+ `${START_MUTED_CLIENT_VIDEO_}.${videoMuted ? 'muted' : 'unmuted'}`);logger.log(`Start muted: ${audioMuted ? 'audio, ' : ''}${videoMuted ? 'video' : ''}`);@@ -123,7 +129,7 @@ function _setRoom({ dispatch, getState }, next, action) {}sendAnalyticsEvent(- `startaudioonly.${audioOnly ? 'enabled' : 'disabled'}`);+ `${START_AUDIO_ONLY_}.${audioOnly ? 'enabled' : 'disabled'}`);logger.log(`Start audio only set to ${audioOnly.toString()}`);dispatch(setAudioOnly(audioOnly));}@@ -150,7 +156,8 @@ function _syncTrackMutedState({ getState }, track) {// fired before track gets to state.if (track.muted !== muted) {sendAnalyticsEvent(- `synctrackstate.${track.mediaType}.${muted ? 'muted' : 'unmuted'}`);+ `${SYNC_TRACK_STATE_}.${track.mediaType}.${+ muted ? 'muted' : 'unmuted'}`);logger.log(`Sync ${track.mediaType} track muted state to ${muted ? 'muted' : 'unmuted'}`);track.muted = muted;diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.jsindex afa44dda6d..02326066b9 100644--- a/react/features/base/tracks/actions.js+++ b/react/features/base/tracks/actions.js@@ -1,4 +1,7 @@-import { sendAnalyticsEvent } from '../../analytics';+import {+ REPLACE_TRACK_,+ sendAnalyticsEvent+} from '../../analytics';import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';import {CAMERA_FACING_MODE,@@ -217,7 +220,7 @@ export function replaceLocalTrack(oldTrack, newTrack, conference) {: setAudioMuted;const isMuted = newTrack.isMuted();- sendAnalyticsEvent(`replacetrack.${+ sendAnalyticsEvent(`${REPLACE_TRACK_}.${newTrack.getType()}.${isMuted ? 'muted' : 'unmuted'}`);logger.log(`Replace ${newTrack.getType()} track - ${diff --git a/react/features/feedback/components/FeedbackDialog.web.js b/react/features/feedback/components/FeedbackDialog.web.jsindex 587094489c..47ff2ac4a2 100644--- a/react/features/feedback/components/FeedbackDialog.web.js+++ b/react/features/feedback/components/FeedbackDialog.web.js@@ -6,7 +6,10 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ FEEDBACK_OPEN,+ sendAnalyticsEvent+} from '../../analytics';import { Dialog } from '../../base/dialog';import { translate } from '../../base/i18n';@@ -145,7 +148,7 @@ class FeedbackDialog extends Component {* @inheritdoc*/componentDidMount() {- sendAnalyticsEvent('feedback.open');+ sendAnalyticsEvent(FEEDBACK_OPEN);}/**diff --git a/react/features/invite/components/InviteDialog.web.js b/react/features/invite/components/InviteDialog.web.jsindex 50ad416f3f..56b0bbfb20 100644--- a/react/features/invite/components/InviteDialog.web.js+++ b/react/features/invite/components/InviteDialog.web.js@@ -2,7 +2,10 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ TOOLBAR_INVITE_CLOSE,+ sendAnalyticsEvent+} from '../../analytics';import { getInviteURL } from '../../base/connection';import { Dialog } from '../../base/dialog';import { translate } from '../../base/i18n';@@ -51,7 +54,7 @@ class InviteDialog extends Component {* @inheritdoc*/componentWillUnmount() {- sendAnalyticsEvent('toolbar.invite.close');+ sendAnalyticsEvent(TOOLBAR_INVITE_CLOSE);}/**diff --git a/react/features/mobile/background/actions.js b/react/features/mobile/background/actions.jsindex 74ac2f98e8..06e49c0378 100644--- a/react/features/mobile/background/actions.js+++ b/react/features/mobile/background/actions.js@@ -1,6 +1,9 @@/* @flow */-import { sendAnalyticsEvent } from '../../analytics';+import {+ CALLKIT_BACKGROUND_VIDEO_MUTED,+ sendAnalyticsEvent+} from '../../analytics';import { setLastN } from '../../base/conference';import { setVideoMuted, VIDEO_MUTISM_AUTHORITY } from '../../base/media';@@ -43,7 +46,7 @@ export function _setBackgroundVideoMuted(muted: boolean) {audioOnly || dispatch(setLastN(muted ? 0 : undefined));- sendAnalyticsEvent('callkit.background.video.muted');+ sendAnalyticsEvent(CALLKIT_BACKGROUND_VIDEO_MUTED);dispatch(setVideoMuted(muted, VIDEO_MUTISM_AUTHORITY.BACKGROUND));};diff --git a/react/features/mobile/callkit/middleware.js b/react/features/mobile/callkit/middleware.jsindex 7e68fbf78e..d2754060a4 100644--- a/react/features/mobile/callkit/middleware.js+++ b/react/features/mobile/callkit/middleware.js@@ -3,7 +3,10 @@import { NativeModules } from 'react-native';import uuid from 'uuid';-import { sendAnalyticsEvent } from '../../analytics';+import {+ CALLKIT_AUDIO_,+ sendAnalyticsEvent+} from '../../analytics';import { APP_WILL_MOUNT, APP_WILL_UNMOUNT, appNavigate } from '../../app';import {CONFERENCE_FAILED,@@ -276,7 +279,8 @@ function _onPerformSetMutedCallAction({ callUUID, muted: newValue }) {if (oldValue !== newValue) {const value = Boolean(newValue);- sendAnalyticsEvent(`callkit.audio.${value ? 'muted' : 'unmuted'}`);+ sendAnalyticsEvent(`${CALLKIT_AUDIO_}.${+ value ? 'muted' : 'unmuted'}`);dispatch(setAudioMuted(value));}}diff --git a/react/features/overlay/components/AbstractPageReloadOverlay.js b/react/features/overlay/components/AbstractPageReloadOverlay.jsindex 97ae75040f..7ce221e5cf 100644--- a/react/features/overlay/components/AbstractPageReloadOverlay.js+++ b/react/features/overlay/components/AbstractPageReloadOverlay.js@@ -3,6 +3,7 @@import PropTypes from 'prop-types';import React, { Component } from 'react';+import { PAGE_RELOAD } from '../../analytics';import {isFatalJitsiConferenceError,isFatalJitsiConnectionError@@ -156,7 +157,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {// sent to the backed.// FIXME: We should dispatch action for this.APP.conference.logEvent(- 'page.reload',+ PAGE_RELOAD,/* value */ undefined,/* label */ this.props.reason);logger.info(diff --git a/react/features/remote-video-menu/components/KickButton.js b/react/features/remote-video-menu/components/KickButton.jsindex 90fad3ae59..7ccbb81381 100644--- a/react/features/remote-video-menu/components/KickButton.js+++ b/react/features/remote-video-menu/components/KickButton.js@@ -2,7 +2,10 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ REMOTE_VIDEO_MENU_KICK,+ sendAnalyticsEvent+} from '../../analytics';import { translate } from '../../base/i18n';import { kickParticipant } from '../../base/participants';@@ -84,7 +87,7 @@ class KickButton extends Component {const { dispatch, onClick, participantID } = this.props;sendAnalyticsEvent(- 'remotevideomenu.kick',+ REMOTE_VIDEO_MENU_KICK,{value: 1,label: participantIDdiff --git a/react/features/remote-video-menu/components/MuteButton.js b/react/features/remote-video-menu/components/MuteButton.jsindex ac66215641..ba5d382a27 100644--- a/react/features/remote-video-menu/components/MuteButton.js+++ b/react/features/remote-video-menu/components/MuteButton.js@@ -2,7 +2,10 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ REMOTE_VIDEO_MENU_MUTE_CLICKED,+ sendAnalyticsEvent+} from '../../analytics';import { translate } from '../../base/i18n';import { openDialog } from '../../base/dialog';@@ -99,7 +102,7 @@ class MuteButton extends Component {const { dispatch, onClick, participantID } = this.props;sendAnalyticsEvent(- 'remotevideomenu.mute.clicked',+ REMOTE_VIDEO_MENU_MUTE_CLICKED,{value: 1,label: participantIDdiff --git a/react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.js b/react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.jsindex 36f996dc5d..fad51ac256 100644--- a/react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.js+++ b/react/features/remote-video-menu/components/MuteRemoteParticipantDialog.web.js@@ -5,7 +5,10 @@ import { connect } from 'react-redux';import { Dialog } from '../../base/dialog';import { translate } from '../../base/i18n';-import { sendAnalyticsEvent } from '../../analytics';+import {+ REMOTE_VIDEO_MENU_MUTE_CONFIRMED,+ sendAnalyticsEvent+} from '../../analytics';import { muteRemoteParticipant } from '../../base/participants';/**@@ -80,7 +83,7 @@ class MuteRemoteParticipantDialog extends Component {const { dispatch, participantID } = this.props;sendAnalyticsEvent(- 'remotevideomenu.mute.confirmed',+ REMOTE_VIDEO_MENU_MUTE_CONFIRMED,{value: 1,label: participantIDdiff --git a/react/features/remote-video-menu/components/RemoteControlButton.js b/react/features/remote-video-menu/components/RemoteControlButton.jsindex 88a33ee65d..f7eaede429 100644--- a/react/features/remote-video-menu/components/RemoteControlButton.js+++ b/react/features/remote-video-menu/components/RemoteControlButton.js@@ -1,7 +1,10 @@import PropTypes from 'prop-types';import React, { Component } from 'react';-import { sendAnalyticsEvent } from '../../analytics';+import {+ REMOTE_VIDEO_MENU_REMOTE_CONTROL_,+ sendAnalyticsEvent+} from '../../analytics';import { translate } from '../../base/i18n';import RemoteVideoMenuButton from './RemoteVideoMenuButton';@@ -131,7 +134,7 @@ class RemoteControlButton extends Component {if (eventName) {sendAnalyticsEvent(- `remotevideomenu.remotecontrol.${eventName}`,+ `${REMOTE_VIDEO_MENU_REMOTE_CONTROL_}.${eventName}`,{value: 1,label: participantIDdiff --git a/react/features/toolbox/components/ProfileButton.web.js b/react/features/toolbox/components/ProfileButton.web.jsindex 97128197f5..c427c65bf7 100644--- a/react/features/toolbox/components/ProfileButton.web.js+++ b/react/features/toolbox/components/ProfileButton.web.js@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import { TOOLBAR_PROFILE_TOGGLED, sendAnalyticsEvent } from '../../analytics';import { DEFAULT_AVATAR_RELATIVE_PATH } from '../../base/participants';import UIEvents from '../../../../service/UI/UIEvents';@@ -102,7 +102,7 @@ class ProfileButton extends Component<*> {*/_onClick() {if (!this.props._unclickable) {- sendAnalyticsEvent('toolbar.profile.toggled');+ sendAnalyticsEvent(TOOLBAR_PROFILE_TOGGLED);APP.UI.emitEvent(UIEvents.TOGGLE_PROFILE);}}diff --git a/react/features/toolbox/components/Toolbox.native.js b/react/features/toolbox/components/Toolbox.native.jsindex f50e4e180c..ccecec2d28 100644--- a/react/features/toolbox/components/Toolbox.native.js+++ b/react/features/toolbox/components/Toolbox.native.js@@ -3,7 +3,12 @@ import React, { Component } from 'react';import { View } from 'react-native';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ TOOLBAR_AUDIO_MUTED,+ TOOLBAR_AUDIO_UNMUTED,+ TOOLBAR_VIDEO_,+ sendAnalyticsEvent+} from '../../analytics';import {isNarrowAspectRatio,makeAspectRatioAware@@ -183,7 +188,7 @@ class Toolbox extends Component {_onToggleAudio() {const mute = !this.props._audioMuted;- sendAnalyticsEvent(`toolbar.audio.${mute ? 'muted' : 'unmuted'}`);+ sendAnalyticsEvent(mute ? TOOLBAR_AUDIO_MUTED : TOOLBAR_AUDIO_UNMUTED);// The user sees the reality i.e. the state of base/tracks and intends// to change reality by tapping on the respective button i.e. the user@@ -206,7 +211,7 @@ class Toolbox extends Component {_onToggleVideo() {const mute = !this.props._videoMuted;- sendAnalyticsEvent(`toolbar.video.${mute ? 'muted' : 'unmuted'}`);+ sendAnalyticsEvent(`${TOOLBAR_VIDEO_}.${mute ? 'muted' : 'unmuted'}`);// The user sees the reality i.e. the state of base/tracks and intends// to change reality by tapping on the respective button i.e. the userdiff --git a/react/features/toolbox/defaultToolbarButtons.web.js b/react/features/toolbox/defaultToolbarButtons.web.jsindex 5dd0203634..4319f3f124 100644--- a/react/features/toolbox/defaultToolbarButtons.web.js+++ b/react/features/toolbox/defaultToolbarButtons.web.js@@ -2,7 +2,31 @@import React from 'react';-import { sendAnalyticsEvent } from '../analytics';+import {+ SHORTCUT_AUDIO_MUTE_TOGGLED,+ SHORTCUT_CHAT_TOGGLED,+ SHORTCUT_RAISE_HAND_CLICKED,+ SHORTCUT_SCREEN_TOGGLED,+ SHORTCUT_VIDEO_MUTE_TOGGLED,+ TOOLBAR_AUDIO_MUTED,+ TOOLBAR_AUDIO_UNMUTED,+ TOOLBAR_CHAT_TOGGLED,+ TOOLBAR_CONTACTS_TOGGLED,+ TOOLBAR_ETHERPACK_CLICKED,+ TOOLBAR_FILMSTRIP_ONLY_DEVICE_SELECTION_TOGGLED,+ TOOLBAR_FULLSCREEN_ENABLED,+ TOOLBAR_HANGUP,+ TOOLBAR_INVITE_CLICKED,+ TOOLBAR_RAISE_HAND_CLICKED,+ TOOLBAR_SCREEN_DISABLED,+ TOOLBAR_SCREEN_ENABLED,+ TOOLBAR_SETTINGS_TOGGLED,+ TOOLBAR_SHARED_VIDEO_CLICKED,+ TOOLBAR_SIP_DIALPAD_CLICKED,+ TOOLBAR_VIDEO_DISABLED,+ TOOLBAR_VIDEO_ENABLED,+ sendAnalyticsEvent+} from '../analytics';import { ParticipantCounter } from '../contact-list';import { openDeviceSelectionDialog } from '../device-selection';import { InfoDialogButton, openInviteDialog } from '../invite';@@ -42,9 +66,9 @@ export default function getDefaultButtons() {const newVideoMutedState = !APP.conference.isLocalVideoMuted();if (newVideoMutedState) {- sendAnalyticsEvent('toolbar.video.enabled');+ sendAnalyticsEvent(TOOLBAR_VIDEO_ENABLED);} else {- sendAnalyticsEvent('toolbar.video.disabled');+ sendAnalyticsEvent(TOOLBAR_VIDEO_DISABLED);}APP.UI.emitEvent(UIEvents.VIDEO_MUTED, newVideoMutedState);},@@ -64,7 +88,7 @@ export default function getDefaultButtons() {return;}- sendAnalyticsEvent('shortcut.videomute.toggled');+ sendAnalyticsEvent(SHORTCUT_VIDEO_MUTE_TOGGLED);APP.conference.toggleVideoMuted();},shortcutDescription: 'keyboardShortcuts.videoMute',@@ -81,13 +105,13 @@ export default function getDefaultButtons() {<span id = 'unreadMessages' /></span>,id: 'toolbar_button_chat',onClick() {- sendAnalyticsEvent('toolbar.chat.toggled');+ sendAnalyticsEvent(TOOLBAR_CHAT_TOGGLED);APP.UI.emitEvent(UIEvents.TOGGLE_CHAT);},shortcut: 'C',shortcutAttr: 'toggleChatPopover',shortcutFunc() {- sendAnalyticsEvent('shortcut.chat.toggled');+ sendAnalyticsEvent(SHORTCUT_CHAT_TOGGLED);APP.UI.toggleChat();},shortcutDescription: 'keyboardShortcuts.toggleChat',@@ -104,8 +128,7 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_contact_list',onClick() {- sendAnalyticsEvent(- 'toolbar.contacts.toggled');+ sendAnalyticsEvent(TOOLBAR_CONTACTS_TOGGLED);APP.UI.emitEvent(UIEvents.TOGGLE_CONTACT_LIST);},sideContainerId: 'contacts_container',@@ -121,9 +144,9 @@ export default function getDefaultButtons() {id: 'toolbar_button_desktopsharing',onClick() {if (APP.conference.isSharingScreen) {- sendAnalyticsEvent('toolbar.screen.disabled');+ sendAnalyticsEvent(TOOLBAR_SCREEN_DISABLED);} else {- sendAnalyticsEvent('toolbar.screen.enabled');+ sendAnalyticsEvent(TOOLBAR_SCREEN_ENABLED);}APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING);},@@ -137,7 +160,7 @@ export default function getDefaultButtons() {shortcut: 'D',shortcutAttr: 'toggleDesktopSharingPopover',shortcutFunc() {- sendAnalyticsEvent('shortcut.screen.toggled');+ sendAnalyticsEvent(SHORTCUT_SCREEN_TOGGLED);// eslint-disable-next-line no-empty-functionAPP.conference.toggleScreenSharing().catch(() => {});@@ -158,7 +181,7 @@ export default function getDefaultButtons() {id: 'toolbar_button_fodeviceselection',onClick(dispatch: Function) {sendAnalyticsEvent(- 'toolbar.fodeviceselection.toggled');+ TOOLBAR_FILMSTRIP_ONLY_DEVICE_SELECTION_TOGGLED);dispatch(openDeviceSelectionDialog());},@@ -177,7 +200,7 @@ export default function getDefaultButtons() {hidden: true,id: 'toolbar_button_dialpad',onClick() {- sendAnalyticsEvent('toolbar.sip.dialpad.clicked');+ sendAnalyticsEvent(TOOLBAR_SIP_DIALPAD_CLICKED);},tooltipKey: 'toolbar.dialpad'},@@ -191,7 +214,7 @@ export default function getDefaultButtons() {hidden: true,id: 'toolbar_button_etherpad',onClick() {- sendAnalyticsEvent('toolbar.etherpad.clicked');+ sendAnalyticsEvent(TOOLBAR_ETHERPACK_CLICKED);APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);},tooltipKey: 'toolbar.etherpad'@@ -205,7 +228,7 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_button_fullScreen',onClick() {- sendAnalyticsEvent('toolbar.fullscreen.enabled');+ sendAnalyticsEvent(TOOLBAR_FULLSCREEN_ENABLED);APP.UI.emitEvent(UIEvents.TOGGLE_FULLSCREEN);},@@ -229,7 +252,7 @@ export default function getDefaultButtons() {isDisplayed: () => true,id: 'toolbar_button_hangup',onClick() {- sendAnalyticsEvent('toolbar.hangup');+ sendAnalyticsEvent(TOOLBAR_HANGUP);APP.UI.emitEvent(UIEvents.HANGUP);},tooltipKey: 'toolbar.hangup'@@ -252,7 +275,7 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_button_link',onClick(dispatch: Function) {- sendAnalyticsEvent('toolbar.invite.clicked');+ sendAnalyticsEvent(TOOLBAR_INVITE_CLICKED);dispatch(openInviteDialog());},@@ -280,11 +303,11 @@ export default function getDefaultButtons() {APP.UI.showCustomToolbarPopup('microphone', 'unableToUnmutePopup', true, 5000);} else {- sendAnalyticsEvent('toolbar.audio.unmuted');+ sendAnalyticsEvent(TOOLBAR_AUDIO_UNMUTED);APP.UI.emitEvent(UIEvents.AUDIO_MUTED, false, true);}} else {- sendAnalyticsEvent('toolbar.audio.muted');+ sendAnalyticsEvent(TOOLBAR_AUDIO_MUTED);APP.UI.emitEvent(UIEvents.AUDIO_MUTED, true, true);}},@@ -305,7 +328,7 @@ export default function getDefaultButtons() {shortcut: 'M',shortcutAttr: 'mutePopover',shortcutFunc() {- sendAnalyticsEvent('shortcut.audiomute.toggled');+ sendAnalyticsEvent(SHORTCUT_AUDIO_MUTE_TOGGLED);APP.conference.toggleAudioMuted();},shortcutDescription: 'keyboardShortcuts.mute',@@ -328,14 +351,14 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_button_raisehand',onClick() {- sendAnalyticsEvent('toolbar.raiseHand.clicked');+ sendAnalyticsEvent(TOOLBAR_RAISE_HAND_CLICKED);APP.conference.maybeToggleRaisedHand();},shortcut: 'R',shortcutAttr: 'raiseHandPopover',shortcutDescription: 'keyboardShortcuts.raiseHand',shortcutFunc() {- sendAnalyticsEvent('shortcut.raisehand.clicked');+ sendAnalyticsEvent(SHORTCUT_RAISE_HAND_CLICKED);APP.conference.maybeToggleRaisedHand();},tooltipKey: 'toolbar.raiseHand'@@ -363,7 +386,7 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_button_settings',onClick() {- sendAnalyticsEvent('toolbar.settings.toggled');+ sendAnalyticsEvent(TOOLBAR_SETTINGS_TOGGLED);APP.UI.emitEvent(UIEvents.TOGGLE_SETTINGS);},sideContainerId: 'settings_container',@@ -378,7 +401,7 @@ export default function getDefaultButtons() {enabled: true,id: 'toolbar_button_sharedvideo',onClick() {- sendAnalyticsEvent('toolbar.sharedvideo.clicked');+ sendAnalyticsEvent(TOOLBAR_SHARED_VIDEO_CLICKED);APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);},popups: [diff --git a/react/features/video-quality/components/VideoQualityDialog.web.js b/react/features/video-quality/components/VideoQualityDialog.web.jsindex 91cd12a65f..e486066d93 100644--- a/react/features/video-quality/components/VideoQualityDialog.web.js+++ b/react/features/video-quality/components/VideoQualityDialog.web.js@@ -3,7 +3,13 @@ import PropTypes from 'prop-types';import React, { Component } from 'react';import { connect } from 'react-redux';-import { sendAnalyticsEvent } from '../../analytics';+import {+ TOOLBAR_AUDIO_ONLY_ENABLED,+ TOOLBAR_VIDEO_QUALITY_HIGH,+ TOOLBAR_VIDEO_QUALITY_LOW,+ TOOLBAR_VIDEO_QUALITY_STANDARD,+ sendAnalyticsEvent+} from '../../analytics';import {setAudioOnly,setReceiveVideoQuality,@@ -249,7 +255,7 @@ class VideoQualityDialog extends Component {* @returns {void}*/_enableAudioOnly() {- sendAnalyticsEvent('toolbar.audioonly.enabled');+ sendAnalyticsEvent(TOOLBAR_AUDIO_ONLY_ENABLED);logger.log('Video quality: audio only enabled');this.props.dispatch(setAudioOnly(true));}@@ -262,7 +268,7 @@ class VideoQualityDialog extends Component {* @returns {void}*/_enableHighDefinition() {- sendAnalyticsEvent('toolbar.videoquality.high');+ sendAnalyticsEvent(TOOLBAR_VIDEO_QUALITY_HIGH);logger.log('Video quality: high enabled');this.props.dispatch(setReceiveVideoQuality(HIGH));}@@ -275,7 +281,7 @@ class VideoQualityDialog extends Component {* @returns {void}*/_enableLowDefinition() {- sendAnalyticsEvent('toolbar.videoquality.low');+ sendAnalyticsEvent(TOOLBAR_VIDEO_QUALITY_LOW);logger.log('Video quality: low enabled');this.props.dispatch(setReceiveVideoQuality(LOW));}@@ -288,7 +294,7 @@ class VideoQualityDialog extends Component {* @returns {void}*/_enableStandardDefinition() {- sendAnalyticsEvent('toolbar.videoquality.standard');+ sendAnalyticsEvent(TOOLBAR_VIDEO_QUALITY_STANDARD);logger.log('Video quality: standard enabled');this.props.dispatch(setReceiveVideoQuality(STANDARD));}