Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Composer/packages/client/src/telemetry/useInitializeLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useInitializeLogger = () => {
const rootProjectId = useRecoilValue(currentProjectIdState);
const { telemetry } = useRecoilValue(userSettingsState);
const {
location: { pathname, href: url },
location: { pathname },
} = useLocation();
const page = useMemo<PageNames>(() => getPageName(pathname), [pathname]);

Expand All @@ -40,8 +40,10 @@ export const useInitializeLogger = () => {
}, []);

useEffect(() => {
TelemetryClient.track('NavigateTo', { sectionName: page, url });
TelemetryClient.pageView(page, url);
// We're currently setting the url to the page name since the url
// could contain sensitive data such as dialog names
TelemetryClient.track('NavigateTo', { sectionName: page, url: page });
TelemetryClient.pageView(page, page);
}, [page]);

const handleBeforeUnload = useCallback(() => {
Expand Down
4 changes: 2 additions & 2 deletions Composer/packages/client/src/utils/getPageName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { PageNames } from '@bfc/shared';

const PagesRegex = {
[PageNames.Design]: /\/dialogs/i,
[PageNames.Home]: /\/home/i,
[PageNames.Design]: /\/dialogs|\/bot\/d+.d+/i,
[PageNames.Home]: /\/|\/home|\/projects\/create|\/projects\/open/i,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this now includes project creation? Would it be better to separate the project creation pages into it's own page category?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per a conversation with @garypretty, since we are already capturing custom events for /project/create and /projects/open it would be redundant to capture them as a page view.

[PageNames.LanguageGeneration]: /\/language-generation/i,
[PageNames.LanguageUnderstanding]: /\/language-understanding/i,
[PageNames.KnowledgeBase]: /\/knowledge-base/i,
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/server/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export enum ClaimNames {

export const APPINSIGHTS_INSTRUMENTATIONKEY = process.env.APPINSIGHTS_INSTRUMENTATIONKEY;

export const piiProperties = ['projectId', 'rootProjectId', 'url'];
export const piiProperties = ['projectId', 'rootProjectId'];

export const COMPOSER_VERSION = '1.3.0';