Переглянути джерело

fix(welcome-page): send analytics on join

master
Leonard Kim 7 роки тому
джерело
коміт
9b04a7852a

+ 19
- 0
react/features/analytics/AnalyticsEvents.js Переглянути файл

@@ -462,3 +462,22 @@ export const createTrackMutedEvent = function(mediaType, reason, muted = true) {
462 462
         }
463 463
     };
464 464
 };
465
+
466
+/**
467
+ * Creates an event for an action on the welcome page.
468
+ *
469
+ * @param {string} action - The action that the event represents.
470
+ * @param {string} actionSubject - The subject that was acted upon.
471
+ * @param {boolean} attributes - Additional attributes to attach to the event.
472
+ * @returns {Object} The event in a format suitable for sending via
473
+ * sendAnalytics.
474
+ */
475
+export const createWelcomePageEvent
476
+    = function(action, actionSubject, attributes = {}) {
477
+        return {
478
+            action,
479
+            actionSubject,
480
+            attributes,
481
+            source: 'welcomePage'
482
+        };
483
+    };

+ 7
- 0
react/features/welcome/components/AbstractWelcomePage.js Переглянути файл

@@ -5,6 +5,7 @@ import { Component } from 'react';
5 5
 
6 6
 import { appNavigate } from '../../app';
7 7
 import { showAppSettings } from '../../app-settings';
8
+import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
8 9
 import { isRoomValid } from '../../base/conference';
9 10
 
10 11
 import { generateRoomWithoutSeparator } from '../functions';
@@ -171,6 +172,12 @@ export class AbstractWelcomePage extends Component<*, *> {
171 172
     _onJoin() {
172 173
         const room = this.state.room || this.state.generatedRoomname;
173 174
 
175
+        sendAnalytics(
176
+            createWelcomePageEvent('clicked', 'joinButton', {
177
+                isGenerated: !this.state.room,
178
+                room
179
+            }));
180
+
174 181
         if (room) {
175 182
             this.setState({ joining: true });
176 183
 

Завантаження…
Відмінити
Зберегти