浏览代码

Adds more analytics events.

j8
damencho 9 年前
父节点
当前提交
e9b7aaea84
共有 3 个文件被更改,包括 21 次插入1 次删除
  1. 7
    0
      conference.js
  2. 6
    1
      modules/UI/Feedback.js
  3. 8
    0
      modules/UI/toolbars/Toolbar.js

+ 7
- 0
conference.js 查看文件

13
 import UIEvents from './service/UI/UIEvents';
13
 import UIEvents from './service/UI/UIEvents';
14
 
14
 
15
 import mediaDeviceHelper from './modules/devices/mediaDeviceHelper';
15
 import mediaDeviceHelper from './modules/devices/mediaDeviceHelper';
16
+import AnalyticsAdapter from './modules/statistics/AnalyticsAdapter';
16
 
17
 
17
 import {reportError} from './modules/util/helpers';
18
 import {reportError} from './modules/util/helpers';
18
 
19
 
889
                 return this.useVideoStream(stream);
890
                 return this.useVideoStream(stream);
890
             }).then(() => {
891
             }).then(() => {
891
                 this.videoSwitchInProgress = false;
892
                 this.videoSwitchInProgress = false;
893
+                AnalyticsAdapter.sendEvent('conference.sharingDesktop.start');
892
                 console.log('sharing local desktop');
894
                 console.log('sharing local desktop');
893
             }).catch((err) => {
895
             }).catch((err) => {
894
                 this.videoSwitchInProgress = false;
896
                 this.videoSwitchInProgress = false;
934
                 ([stream]) => this.useVideoStream(stream)
936
                 ([stream]) => this.useVideoStream(stream)
935
             ).then(() => {
937
             ).then(() => {
936
                 this.videoSwitchInProgress = false;
938
                 this.videoSwitchInProgress = false;
939
+                AnalyticsAdapter.sendEvent('conference.sharingDesktop.stop');
937
                 console.log('sharing local video');
940
                 console.log('sharing local video');
938
             }).catch((err) => {
941
             }).catch((err) => {
939
                 this.useVideoStream(null);
942
                 this.useVideoStream(null);
1292
             try {
1295
             try {
1293
                 room.selectParticipant(id);
1296
                 room.selectParticipant(id);
1294
             } catch (e) {
1297
             } catch (e) {
1298
+                AnalyticsAdapter.sendEvent('selectParticipant.failed');
1295
                 reportError(e);
1299
                 reportError(e);
1296
             }
1300
             }
1297
         });
1301
         });
1316
         APP.UI.addListener(
1320
         APP.UI.addListener(
1317
             UIEvents.VIDEO_DEVICE_CHANGED,
1321
             UIEvents.VIDEO_DEVICE_CHANGED,
1318
             (cameraDeviceId) => {
1322
             (cameraDeviceId) => {
1323
+                AnalyticsAdapter.sendEvent('settings.changeDevice.video');
1319
                 createLocalTracks({
1324
                 createLocalTracks({
1320
                     devices: ['video'],
1325
                     devices: ['video'],
1321
                     cameraDeviceId: cameraDeviceId,
1326
                     cameraDeviceId: cameraDeviceId,
1336
         APP.UI.addListener(
1341
         APP.UI.addListener(
1337
             UIEvents.AUDIO_DEVICE_CHANGED,
1342
             UIEvents.AUDIO_DEVICE_CHANGED,
1338
             (micDeviceId) => {
1343
             (micDeviceId) => {
1344
+                AnalyticsAdapter.sendEvent('settings.changeDevice.audioIn');
1339
                 createLocalTracks({
1345
                 createLocalTracks({
1340
                     devices: ['audio'],
1346
                     devices: ['audio'],
1341
                     cameraDeviceId: null,
1347
                     cameraDeviceId: null,
1356
         APP.UI.addListener(
1362
         APP.UI.addListener(
1357
             UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
1363
             UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
1358
             (audioOutputDeviceId) => {
1364
             (audioOutputDeviceId) => {
1365
+                AnalyticsAdapter.sendEvent('settings.changeDevice.audioOut');
1359
                 APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
1366
                 APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
1360
                     .then(() => console.log('changed audio output device'))
1367
                     .then(() => console.log('changed audio output device'))
1361
                     .catch((err) => {
1368
                     .catch((err) => {

+ 6
- 1
modules/UI/Feedback.js 查看文件

1
 /* global $, APP, config, interfaceConfig */
1
 /* global $, APP, config, interfaceConfig */
2
 import UIEvents from "../../service/UI/UIEvents";
2
 import UIEvents from "../../service/UI/UIEvents";
3
+import AnalyticsAdapter from '../statistics/AnalyticsAdapter';
3
 
4
 
4
 /**
5
 /**
5
  * Constructs the html for the overall feedback window.
6
  * Constructs the html for the overall feedback window.
199
                         var feedbackDetails
200
                         var feedbackDetails
200
                             = document.getElementById("feedbackTextArea").value;
201
                             = document.getElementById("feedbackTextArea").value;
201
 
202
 
202
-                        if (feedbackDetails && feedbackDetails.length > 0)
203
+                        if (feedbackDetails && feedbackDetails.length > 0) {
204
+                            AnalyticsAdapter.sendEvent(
205
+                                'feedback.rating', Feedback.feedbackScore);
203
                             APP.conference.sendFeedback( Feedback.feedbackScore,
206
                             APP.conference.sendFeedback( Feedback.feedbackScore,
204
                                                     feedbackDetails);
207
                                                     feedbackDetails);
208
+                        }
205
 
209
 
206
                         if (feedbackWindowCallback)
210
                         if (feedbackWindowCallback)
207
                             feedbackWindowCallback();
211
                             feedbackWindowCallback();
227
                     closeText: '',
231
                     closeText: '',
228
                     loaded: onLoadFunction,
232
                     loaded: onLoadFunction,
229
                     position: {width: 500}}, null);
233
                     position: {width: 500}}, null);
234
+        AnalyticsAdapter.sendEvent('feedback.open');
230
     },
235
     },
231
     /**
236
     /**
232
      * Toggles the appropriate css class for the given number of stars, to
237
      * Toggles the appropriate css class for the given number of stars, to

+ 8
- 0
modules/UI/toolbars/Toolbar.js 查看文件

26
         false, "dialog.Invite",
26
         false, "dialog.Invite",
27
         function (e, v) {
27
         function (e, v) {
28
             if (v && roomUrl) {
28
             if (v && roomUrl) {
29
+                AnalyticsAdapter.sendEvent('toolbar.invite.button');
29
                 emitter.emit(UIEvents.USER_INVITED, roomUrl);
30
                 emitter.emit(UIEvents.USER_INVITED, roomUrl);
30
             }
31
             }
32
+            else {
33
+                AnalyticsAdapter.sendEvent('toolbar.invite.cancel');
34
+            }
31
         },
35
         },
32
         function (event) {
36
         function (event) {
33
             if (roomUrl) {
37
             if (roomUrl) {
37
                     $(event.target).find('button[value=true]').prop('disabled', true);
41
                     $(event.target).find('button[value=true]').prop('disabled', true);
38
                 }
42
                 }
39
             }
43
             }
44
+        },
45
+        function (e, v, m, f) {
46
+            if(!v && !m && !f)
47
+                AnalyticsAdapter.sendEvent('toolbar.invite.close');
40
         }
48
         }
41
     );
49
     );
42
 }
50
 }

正在加载...
取消
保存