瀏覽代碼

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

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

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

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

@@ -26,8 +26,12 @@ function openLinkDialog () {
26 26
         false, "dialog.Invite",
27 27
         function (e, v) {
28 28
             if (v && roomUrl) {
29
+                AnalyticsAdapter.sendEvent('toolbar.invite.button');
29 30
                 emitter.emit(UIEvents.USER_INVITED, roomUrl);
30 31
             }
32
+            else {
33
+                AnalyticsAdapter.sendEvent('toolbar.invite.cancel');
34
+            }
31 35
         },
32 36
         function (event) {
33 37
             if (roomUrl) {
@@ -37,6 +41,10 @@ function openLinkDialog () {
37 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
 }

Loading…
取消
儲存