Skip to content

Commit ff25c9c

Browse files
authored
chore: add tracking on side panel open (supabase#33349)
1 parent 4649bf9 commit ff25c9c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

apps/studio/components/interfaces/Organization/BillingSettings/Subscription/PlanUpdateSidePanel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ const PlanUpdateSidePanel = () => {
126126
useEffect(() => {
127127
if (visible) {
128128
setSelectedTier(undefined)
129+
sendEvent({
130+
action: TelemetryActions.STUDIO_PRICING_SIDE_PANEL_OPENED,
131+
properties: {
132+
currentPlan: subscription?.plan?.name,
133+
},
134+
groups: { organization: slug ?? 'Unknown' },
135+
})
129136
}
130137
// eslint-disable-next-line react-hooks/exhaustive-deps
131138
}, [visible])

packages/common/telemetry-constants.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export enum TelemetryActions {
7070
IMPORT_DATA_ADDED = 'import_data_added',
7171
SQL_EDITOR_QUERY_RUN_BUTTON_CLICKED = 'sql_editor_query_run_button_clicked',
7272
STUDIO_PRICING_PLAN_CTA_CLICKED = 'studio_pricing_plan_cta_clicked',
73+
STUDIO_PRICING_SIDE_PANEL_OPENED = 'studio_pricing_side_panel_opened',
7374
}
7475

7576
/**
@@ -1059,6 +1060,19 @@ export interface StudioPricingPlanCtaClickedEvent {
10591060
groups: { organization: string }
10601061
}
10611062

1063+
/**
1064+
* User opened the pricing side panel in studio.
1065+
*
1066+
* @group Events
1067+
* @source studio
1068+
* @page /billing?panel=subscriptionPlan
1069+
*/
1070+
export interface StudioPricingSidePanelOpenedEvent {
1071+
action: TelemetryActions.STUDIO_PRICING_SIDE_PANEL_OPENED
1072+
properties: { currentPlan?: string }
1073+
groups: { organization: string }
1074+
}
1075+
10621076
export type TelemetryEvent =
10631077
| SignUpEvent
10641078
| SignInEvent
@@ -1119,3 +1133,4 @@ export type TelemetryEvent =
11191133
| SendFeedbackButtonClickedEvent
11201134
| SqlEditorQueryRunButtonClickedEvent
11211135
| StudioPricingPlanCtaClickedEvent
1136+
| StudioPricingSidePanelOpenedEvent

0 commit comments

Comments
 (0)