1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-02-07 19:30:18 +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) => { const ctaHandler = (e: React.MouseEvent) => {
e.preventDefault() e.preventDefault()
const windowAny = (window as any) 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. // 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' role='button'
onClick={() => { onClick={() => {
props.onClose(); props.onClose();
(window as any).openPricingModal()() (window as any).openPricingModal()({trackingLocation: 'boards > learn_more_about_our_plans_click'})
}} }}
> >
<FormattedMessage <FormattedMessage
@ -179,7 +179,7 @@ const CardDetail = (props: Props): JSX.Element|null => {
className='CardDetail__limited-button' className='CardDetail__limited-button'
onClick={() => { onClick={() => {
props.onClose(); props.onClose();
(window as any).openPricingModal()() (window as any).openPricingModal()({trackingLocation: 'boards > upgrade_click'})
}} }}
emphasis='primary' emphasis='primary'
size='large' size='large'

View File

@ -119,7 +119,7 @@ const CardLimitNotification = (props: Props) => {
}, [me?.id]) }, [me?.id])
const onClick = useCallback(() => { 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, {}) 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}) telemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewLimitCTAPerformed, {board: board.id})
if (isAdmin) { if (isAdmin) {
(window as any)?.openPricingModal()() (window as any)?.openPricingModal()({trackingLocation: 'boards > view_limit_dialog'})
} else { } else {
await octoClient.notifyAdminUpgrade() await octoClient.notifyAdminUpgrade()
props.showNotifyAdminSuccess() props.showNotifyAdminSuccess()

View File

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