浏览代码

feat(URL): Add metrics for config overwrites.

Add temporary metrics for interfaceConfig and config url overwrites.
factor2
Hristo Terezov 6 个月前
父节点
当前提交
478852c474
共有 1 个文件被更改,包括 39 次插入0 次删除
  1. 39
    0
      react/features/analytics/functions.ts

+ 39
- 0
react/features/analytics/functions.ts 查看文件

@@ -15,6 +15,7 @@ import { isAnalyticsEnabled } from '../base/lib-jitsi-meet/functions.any';
15 15
 import { getJitsiMeetGlobalNS } from '../base/util/helpers';
16 16
 import { inIframe } from '../base/util/iframeUtils';
17 17
 import { loadScript } from '../base/util/loadScript';
18
+import { parseURLParams } from '../base/util/parseURLParams';
18 19
 import { parseURIString } from '../base/util/uri';
19 20
 import { isPrejoinPageVisible } from '../prejoin/functions';
20 21
 
@@ -176,6 +177,7 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
176 177
     const { group, server } = state['features/base/jwt'];
177 178
     const { locationURL = { href: '' } } = state['features/base/connection'];
178 179
     const { tenant } = parseURIString(locationURL.href) || {};
180
+    const params = parseURLParams(locationURL.href) ?? {};
179 181
     const permanentProperties: {
180 182
         appName?: string;
181 183
         externalApi?: boolean;
@@ -183,6 +185,13 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
183 185
         inIframe?: boolean;
184 186
         isPromotedFromVisitor?: boolean;
185 187
         isVisitor?: boolean;
188
+        overwritesDefaultLogoUrl?: boolean;
189
+        overwritesDeploymentUrls?: boolean;
190
+        overwritesLiveStreamingUrls?: boolean;
191
+        overwritesPeopleSearchUrl?: boolean;
192
+        overwritesPrejoinConfigICEUrl?: boolean;
193
+        overwritesSalesforceUrl?: boolean;
194
+        overwritesSupportUrl?: boolean;
186 195
         server?: string;
187 196
         tenant?: string;
188 197
         wasLobbyVisible?: boolean;
@@ -221,6 +230,36 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
221 230
     permanentProperties.isVisitor = false;
222 231
     permanentProperties.isPromotedFromVisitor = false;
223 232
 
233
+    // TODO: Temporary metric. To be removed once we don't need it.
234
+    permanentProperties.overwritesSupportUrl = 'interfaceConfig.SUPPORT_URL' in params;
235
+    permanentProperties.overwritesSalesforceUrl = 'config.salesforceUrl' in params;
236
+    permanentProperties.overwritesPeopleSearchUrl = 'config.peopleSearchUrl' in params;
237
+    permanentProperties.overwritesDefaultLogoUrl = 'config.defaultLogoUrl' in params;
238
+    const prejoinConfig = params['config.prejoinConfig'] ?? {};
239
+
240
+    permanentProperties.overwritesPrejoinConfigICEUrl = ('config.prejoinConfig.preCallTestICEUrl' in params)
241
+    || (typeof prejoinConfig === 'object' && 'preCallTestICEUrl' in prejoinConfig);
242
+    const deploymentUrlsConfig = params['config.deploymentUrls'] ?? {};
243
+
244
+    permanentProperties.overwritesDeploymentUrls
245
+        = 'config.deploymentUrls.downloadAppsUrl' in params || 'config.deploymentUrls.userDocumentationURL' in params
246
+            || (typeof deploymentUrlsConfig === 'object'
247
+                && ('downloadAppsUrl' in deploymentUrlsConfig || 'userDocumentationURL' in deploymentUrlsConfig));
248
+    const liveStreamingConfig = params['config.liveStreaming'] ?? {};
249
+
250
+    permanentProperties.overwritesLiveStreamingUrls
251
+        = ('interfaceConfig.LIVE_STREAMING_HELP_LINK' in params)
252
+            || ('config.liveStreaming.termsLink' in params)
253
+            || ('config.liveStreaming.dataPrivacyLink' in params)
254
+            || ('config.liveStreaming.helpLink' in params)
255
+            || (typeof params['config.liveStreaming'] === 'object' && 'config.liveStreaming' in params
256
+                && (
257
+                    'termsLink' in liveStreamingConfig
258
+                    || 'dataPrivacyLink' in liveStreamingConfig
259
+                    || 'helpLink' in liveStreamingConfig
260
+                )
261
+            );
262
+
224 263
     // Optionally, include local deployment information based on the
225 264
     // contents of window.config.deploymentInfo.
226 265
     if (deploymentInfo) {

正在加载...
取消
保存