1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-02-01 19:14:35 +02:00

Merge pull request #3668 from mattermost/MM-45761

[MM-45761] - Telemetry: Track how many users end up in purchase/pricing modal/notify admin
This commit is contained in:
Allan Guwatudde 2022-08-26 15:17:30 +03:00 committed by GitHub
commit 82007d81e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -8,7 +8,7 @@ const PostTypeCloudUpgradeNudge = (props: {post: Post}): JSX.Element => {
const ctaHandler = (e: React.MouseEvent) => {
e.preventDefault()
const windowAny = (window as any)
windowAny?.openPricingModal()()
windowAny?.openPricingModal()({trackingLocation: 'boards > click_view_upgrade_options_nudge'})
}
// custom post type doesn't support styling via CSS stylesheet.

View File

@ -166,7 +166,7 @@ const CardDetail = (props: Props): JSX.Element|null => {
role='button'
onClick={() => {
props.onClose();
(window as any).openPricingModal()()
(window as any).openPricingModal()({trackingLocation: 'boards > learn_more_about_our_plans_click'})
}}
>
<FormattedMessage
@ -179,7 +179,7 @@ const CardDetail = (props: Props): JSX.Element|null => {
className='CardDetail__limited-button'
onClick={() => {
props.onClose();
(window as any).openPricingModal()()
(window as any).openPricingModal()({trackingLocation: 'boards > upgrade_click'})
}}
emphasis='primary'
size='large'

View File

@ -119,7 +119,7 @@ const CardLimitNotification = (props: Props) => {
}, [me?.id])
const onClick = useCallback(() => {
(window as any).openPricingModal()()
(window as any).openPricingModal()({trackingLocation: 'boards > card_limit_notification_upgrade_to_a_paid_plan_click'})
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.LimitCardLimitLinkOpen, {})
}, [])

View File

@ -80,7 +80,7 @@ export const ViewLimitModal = (props: Props): JSX.Element => {
telemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewLimitCTAPerformed, {board: board.id})
if (isAdmin) {
(window as any)?.openPricingModal()()
(window as any)?.openPricingModal()({trackingLocation: 'boards > view_limit_dialog'})
} else {
await octoClient.notifyAdminUpgrade()
props.showNotifyAdminSuccess()

View File

@ -1,5 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
type TelemetryProps = {
trackingLocation: string;
}
export interface IAppWindow extends Window {
baseURL?: string
frontendBaseURL?: string
@ -8,7 +12,7 @@ export interface IAppWindow extends Window {
msCrypto: Crypto
openInNewBrowser?: ((href: string) => void) | null
webkit?: {messageHandlers: {nativeApp?: {postMessage: <T>(message: T) => void}}}
openPricingModal?: () => () => void
openPricingModal?: () => (telemetry: TelemetryProps) => void
}
// SuiteWindow documents all custom properties