Pārlūkot izejas kodu

feat(analytics): Add tenant.

master
Hristo Terezov 4 gadus atpakaļ
vecāks
revīzija
79e517ed65

+ 6
- 1
react/features/analytics/functions.js Parādīt failu

@@ -11,7 +11,7 @@ import JitsiMeetJS, {
11 11
     browser,
12 12
     isAnalyticsEnabled
13 13
 } from '../base/lib-jitsi-meet';
14
-import { getJitsiMeetGlobalNS, loadScript } from '../base/util';
14
+import { getJitsiMeetGlobalNS, loadScript, parseURIString } from '../base/util';
15 15
 
16 16
 import { AmplitudeHandler, MatomoHandler } from './handlers';
17 17
 import logger from './logger';
@@ -166,6 +166,8 @@ export function initAnalytics({ getState }: { getState: Function }, handlers: Ar
166 166
     } = config;
167 167
     const { group, server } = state['features/base/jwt'];
168 168
     const roomName = state['features/base/conference'].room;
169
+    const { locationURL = {} } = state['features/base/connection'];
170
+    const { tenant } = parseURIString(locationURL.href) || {};
169 171
     const permanentProperties = {};
170 172
 
171 173
     if (server) {
@@ -187,6 +189,9 @@ export function initAnalytics({ getState }: { getState: Function }, handlers: Ar
187 189
     // Report if we are loaded in iframe
188 190
     permanentProperties.inIframe = _inIframe();
189 191
 
192
+    // Report the tenant from the URL.
193
+    permanentProperties.tenant = tenant || '/';
194
+
190 195
     // Optionally, include local deployment information based on the
191 196
     // contents of window.config.deploymentInfo.
192 197
     if (deploymentInfo) {

+ 5
- 0
react/features/base/util/uri.js Parādīt failu

@@ -363,6 +363,11 @@ export function parseURIString(uri: ?string) {
363 363
     }
364 364
     obj.room = room;
365 365
 
366
+    if (contextRootEndIndex > 1) {
367
+        // The part of the pathname from the beginning to the room name is the tenant.
368
+        obj.tenant = pathname.substring(1, contextRootEndIndex);
369
+    }
370
+
366 371
     return obj;
367 372
 }
368 373
 

Notiek ielāde…
Atcelt
Saglabāt