浏览代码

feat(analytics): Add tenant.

master
Hristo Terezov 4 年前
父节点
当前提交
79e517ed65
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 6
    1
      react/features/analytics/functions.js
  2. 5
    0
      react/features/base/util/uri.js

+ 6
- 1
react/features/analytics/functions.js 查看文件

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

+ 5
- 0
react/features/base/util/uri.js 查看文件

363
     }
363
     }
364
     obj.room = room;
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
     return obj;
371
     return obj;
367
 }
372
 }
368
 
373
 

正在加载...
取消
保存