Skip to content

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

feat(analytics): Add tenant.

Hristo Terezov79e517ed6552
diff --git a/react/features/analytics/functions.js b/react/features/analytics/functions.js
index f794837382..d15f841e83 100644
--- a/react/features/analytics/functions.js
+++ b/react/features/analytics/functions.js
@@ -11,7 +11,7 @@ import JitsiMeetJS, {
browser,
isAnalyticsEnabled
} from '../base/lib-jitsi-meet';
-import { getJitsiMeetGlobalNS, loadScript } from '../base/util';
+import { getJitsiMeetGlobalNS, loadScript, parseURIString } from '../base/util';
import { AmplitudeHandler, MatomoHandler } from './handlers';
import logger from './logger';
@@ -166,6 +166,8 @@ export function initAnalytics({ getState }: { getState: Function }, handlers: Ar
} = config;
const { group, server } = state['features/base/jwt'];
const roomName = state['features/base/conference'].room;
+ const { locationURL = {} } = state['features/base/connection'];
+ const { tenant } = parseURIString(locationURL.href) || {};
const permanentProperties = {};
if (server) {
@@ -187,6 +189,9 @@ export function initAnalytics({ getState }: { getState: Function }, handlers: Ar
// Report if we are loaded in iframe
permanentProperties.inIframe = _inIframe();
+ // Report the tenant from the URL.
+ permanentProperties.tenant = tenant || '/';
+
// Optionally, include local deployment information based on the
// contents of window.config.deploymentInfo.
if (deploymentInfo) {
diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js
index d9d7711ddb..dae116a048 100644
--- a/react/features/base/util/uri.js
+++ b/react/features/base/util/uri.js
@@ -363,6 +363,11 @@ export function parseURIString(uri: ?string) {
}
obj.room = room;
+ if (contextRootEndIndex > 1) {
+ // The part of the pathname from the beginning to the room name is the tenant.
+ obj.tenant = pathname.substring(1, contextRootEndIndex);
+ }
+
return obj;
}