Skip to content

Commit

Permalink
feat(URL): Add metrics for config overwrites.
Browse files Browse the repository at this point in the history
Add temporary metrics for interfaceConfig and config url overwrites.
  • Loading branch information
hristoterezov committed Nov 25, 2024
1 parent c2f4dd9 commit c99d06e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions react/features/analytics/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { isAnalyticsEnabled } from '../base/lib-jitsi-meet/functions.any';
import { getJitsiMeetGlobalNS } from '../base/util/helpers';
import { inIframe } from '../base/util/iframeUtils';
import { loadScript } from '../base/util/loadScript';
import { parseURLParams } from '../base/util/parseURLParams';
import { parseURIString } from '../base/util/uri';
import { isPrejoinPageVisible } from '../prejoin/functions';

Expand Down Expand Up @@ -176,13 +177,21 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
const { group, server } = state['features/base/jwt'];
const { locationURL = { href: '' } } = state['features/base/connection'];
const { tenant } = parseURIString(locationURL.href) || {};
const params = parseURLParams(locationURL.href) ?? {};
const permanentProperties: {
appName?: string;
externalApi?: boolean;
group?: string;
inIframe?: boolean;
isPromotedFromVisitor?: boolean;
isVisitor?: boolean;
overwritesDefaultLogoUrl?: boolean;
overwritesDeploymentUrls?: boolean;
overwritesLiveStreamingUrls?: boolean;
overwritesPeopleSearchUrl?: boolean;
overwritesPrejoinConfigICEUrl?: boolean;
overwritesSalesforceUrl?: boolean;
overwritesSupportUrl?: boolean;
server?: string;
tenant?: string;
wasLobbyVisible?: boolean;
Expand Down Expand Up @@ -221,6 +230,36 @@ export function initAnalytics(store: IStore, handlers: Array<Object>): boolean {
permanentProperties.isVisitor = false;
permanentProperties.isPromotedFromVisitor = false;

// TODO: Temporary metric. To be removed once we don't need it.
permanentProperties.overwritesSupportUrl = 'interfaceConfig.SUPPORT_URL' in params;
permanentProperties.overwritesSalesforceUrl = 'config.salesforceUrl' in params;
permanentProperties.overwritesPeopleSearchUrl = 'config.peopleSearchUrl' in params;
permanentProperties.overwritesDefaultLogoUrl = 'config.defaultLogoUrl' in params;
const prejoinConfig = params['config.prejoinConfig'] ?? {};

permanentProperties.overwritesPrejoinConfigICEUrl = ('config.prejoinConfig.preCallTestICEUrl' in params)
|| (typeof prejoinConfig === 'object' && 'preCallTestICEUrl' in prejoinConfig);
const deploymentUrlsConfig = params['config.deploymentUrls'] ?? {};

permanentProperties.overwritesDeploymentUrls
= 'config.deploymentUrls.downloadAppsUrl' in params || 'config.deploymentUrls.userDocumentationURL' in params
|| (typeof deploymentUrlsConfig === 'object'
&& ('downloadAppsUrl' in deploymentUrlsConfig || 'userDocumentationURL' in deploymentUrlsConfig));
const liveStreamingConfig = params['config.liveStreaming'] ?? {};

permanentProperties.overwritesLiveStreamingUrls
= ('interfaceConfig.LIVE_STREAMING_HELP_LINK' in params)
|| ('config.liveStreaming.termsLink' in params)
|| ('config.liveStreaming.dataPrivacyLink' in params)
|| ('config.liveStreaming.helpLink' in params)
|| (typeof params['config.liveStreaming'] === 'object' && 'config.liveStreaming' in params
&& (
'termsLink' in liveStreamingConfig
|| 'dataPrivacyLink' in liveStreamingConfig
|| 'helpLink' in liveStreamingConfig
)
);

// Optionally, include local deployment information based on the
// contents of window.config.deploymentInfo.
if (deploymentInfo) {
Expand Down

0 comments on commit c99d06e

Please sign in to comment.