From a3036730b43bc24e75e094f0e22fa22d83b00e0f Mon Sep 17 00:00:00 2001 From: MoxAmber Date: Wed, 17 Jun 2026 15:32:37 +0100 Subject: [PATCH] Merge pull request #34644 from overleaf/as-link-sharing-analytics [web] Add sharing link analytics events GitOrigin-RevId: b206732397065c399d38a8e42dbdebe60222fb24 --- .../components/copy-sharing-link-button.tsx | 8 +++++++- .../components/project-access.tsx | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/share-project-modal/components/copy-sharing-link-button.tsx b/services/web/frontend/js/features/share-project-modal/components/copy-sharing-link-button.tsx index 972241544a..c623727151 100644 --- a/services/web/frontend/js/features/share-project-modal/components/copy-sharing-link-button.tsx +++ b/services/web/frontend/js/features/share-project-modal/components/copy-sharing-link-button.tsx @@ -5,6 +5,7 @@ import { useProjectContext } from '@/shared/context/project-context' import { useUserContext } from '@/shared/context/user-context' import { debugConsole } from '@/utils/debugging' import getMeta from '@/utils/meta' +import { sendMB } from '@/infrastructure/event-tracking' export default function CopySharingLinkButton() { const { t } = useTranslation() @@ -31,7 +32,12 @@ export default function CopySharingLinkButton() { navigator.clipboard .writeText(link) - .then(() => setSuccessActionMessage(t('link_copied'))) + .then(() => { + setSuccessActionMessage(t('link_copied')) + sendMB('sharing-link-copied', { + project_id: projectId, + }) + }) .catch(debugConsole.error) } diff --git a/services/web/frontend/js/features/share-project-modal/components/project-access.tsx b/services/web/frontend/js/features/share-project-modal/components/project-access.tsx index 611954cb6b..af2857c396 100644 --- a/services/web/frontend/js/features/share-project-modal/components/project-access.tsx +++ b/services/web/frontend/js/features/share-project-modal/components/project-access.tsx @@ -30,6 +30,7 @@ import { import { ExcludeStrict } from '@ol-types/utils' import getMeta from '@/utils/meta' import { useFeatureFlag } from '@/shared/context/split-test-context' +import { sendMB } from '@/infrastructure/event-tracking' type ProjectAccessProps = { setIsInvitedPeopleScreen: React.Dispatch> @@ -95,6 +96,11 @@ function ProjectAccess({ setSharingLinkData(data) setProjectAccess(newAccess) setSuccessActionMessage(t('access_updated')) + sendMB('sharing-link-set-permissions', { + project_id: projectId, + access_level: newAccess.split('.')[0], + ...reqBody, + }) }) } @@ -122,6 +128,12 @@ function ProjectAccess({ ).then(data => { setSharingLinkData(data) setSuccessActionMessage(t('access_updated')) + sendMB('sharing-link-set-permissions', { + project_id: projectId, + access_level: projectAccess?.split('.')[0], + privileges: eventKey, + subscriptionId: data.subscriptionId, + }) }) }