Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(welcome-page): send analytics on join

Leonard Kim9b04a7852a18
diff --git a/react/features/analytics/AnalyticsEvents.js b/react/features/analytics/AnalyticsEvents.js
index e2b3937ebe..3006d00e58 100644
--- a/react/features/analytics/AnalyticsEvents.js
+++ b/react/features/analytics/AnalyticsEvents.js
@@ -462,3 +462,22 @@ export const createTrackMutedEvent = function(mediaType, reason, muted = true) {
}
};
};
+
+/**
+ * Creates an event for an action on the welcome page.
+ *
+ * @param {string} action - The action that the event represents.
+ * @param {string} actionSubject - The subject that was acted upon.
+ * @param {boolean} attributes - Additional attributes to attach to the event.
+ * @returns {Object} The event in a format suitable for sending via
+ * sendAnalytics.
+ */
+export const createWelcomePageEvent
+ = function(action, actionSubject, attributes = {}) {
+ return {
+ action,
+ actionSubject,
+ attributes,
+ source: 'welcomePage'
+ };
+ };
diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js
index 7aeea064d6..cb1f9076ce 100644
--- a/react/features/welcome/components/AbstractWelcomePage.js
+++ b/react/features/welcome/components/AbstractWelcomePage.js
@@ -5,6 +5,7 @@ import { Component } from 'react';
import { appNavigate } from '../../app';
import { showAppSettings } from '../../app-settings';
+import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
import { isRoomValid } from '../../base/conference';
import { generateRoomWithoutSeparator } from '../functions';
@@ -171,6 +172,12 @@ export class AbstractWelcomePage extends Component<*, *> {
_onJoin() {
const room = this.state.room || this.state.generatedRoomname;
+ sendAnalytics(
+ createWelcomePageEvent('clicked', 'joinButton', {
+ isGenerated: !this.state.room,
+ room
+ }));
+
if (room) {
this.setState({ joining: true });