Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: add sql editor telemetry docs (#31239)

Pamela Chia65050e202be6
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx
index 1ee8e1d403f..5f1c2fba0b2 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLQuickstarts.tsx
@@ -78,7 +78,7 @@ const SQLQuickstarts = () => {
handleNewQuery(sql, title)
sendEvent({
action: TelemetryActions.SQL_EDITOR_QUICKSTART_CLICKED,
- properties: { title },
+ properties: { quickstartName: title },
})
}}
/>
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
index 93931d586ed..fc8e1014ff3 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
@@ -78,7 +78,7 @@ const SQLTemplates = () => {
handleNewQuery(sql, title)
sendEvent({
action: TelemetryActions.SQL_EDITOR_TEMPLATE_CLICKED,
- properties: { title },
+ properties: { templateName: title },
})
}}
/>
diff --git a/apps/studio/data/telemetry/send-event-mutation.ts b/apps/studio/data/telemetry/send-event-mutation.ts
index 2cc8968b088..ddf51171365 100644
--- a/apps/studio/data/telemetry/send-event-mutation.ts
+++ b/apps/studio/data/telemetry/send-event-mutation.ts
@@ -16,6 +16,11 @@ import {
FeaturePreviewsClickedEvent,
FeaturePreviewEnabledEvent,
FeaturePreviewDisabledEvent,
+ SqlEditorQuickstartClickedEvent,
+ SqlEditorTemplateClickedEvent,
+ SqlEditorResultDownloadCsvClickedEvent,
+ SqlEditorResultCopyMarkdownClickedEvent,
+ SqlEditorResultCopyJsonClickedEvent,
TelemetryActions,
} from 'lib/constants/telemetry'
import { useRouter } from 'next/router'
@@ -33,6 +38,11 @@ export type SendEventVariables =
| FeaturePreviewsClickedEvent
| FeaturePreviewEnabledEvent
| FeaturePreviewDisabledEvent
+ | SqlEditorQuickstartClickedEvent
+ | SqlEditorTemplateClickedEvent
+ | SqlEditorResultDownloadCsvClickedEvent
+ | SqlEditorResultCopyMarkdownClickedEvent
+ | SqlEditorResultCopyJsonClickedEvent
// TODO remove this once all events are documented
| {
diff --git a/apps/studio/lib/constants/telemetry.ts b/apps/studio/lib/constants/telemetry.ts
index 80b1d84c5b8..d3a9c732ebb 100644
--- a/apps/studio/lib/constants/telemetry.ts
+++ b/apps/studio/lib/constants/telemetry.ts
@@ -208,3 +208,70 @@ export interface FeaturePreviewDisabledEvent {
feature: string
}
}
+
+/**
+ * Quickstart card clicked in the SQL editor.
+ *
+ * @group Events
+ * @source studio
+ * @page /dashboard/project/{ref}/sql
+ */
+export interface SqlEditorQuickstartClickedEvent {
+ action: TelemetryActions.SQL_EDITOR_QUICKSTART_CLICKED
+ properties: {
+ /**
+ * The title of the quickstart card clicked.
+ */
+ quickstartName: string
+ }
+}
+
+/**
+ * Template card clicked in the SQL editor.
+ *
+ * @group Events
+ * @source studio
+ * @page /dashboard/project/{ref}/sql
+ */
+export interface SqlEditorTemplateClickedEvent {
+ action: TelemetryActions.SQL_EDITOR_TEMPLATE_CLICKED
+ properties: {
+ /**
+ * The name of the template card clicked.
+ */
+ templateName: string
+ }
+}
+
+/**
+ * Result download CSV button clicked in the SQL editor.
+ *
+ * @group Events
+ * @source studio
+ * @page /dashboard/project/{ref}/sql
+ */
+export interface SqlEditorResultDownloadCsvClickedEvent {
+ action: TelemetryActions.SQL_EDITOR_RESULT_DOWNLOAD_CSV_CLICKED
+}
+
+/**
+ * Result copy markdown button clicked in the SQL editor.
+ *
+ * @group Events
+ * @source studio
+ * @page /dashboard/project/{ref}/sql
+ */
+export interface SqlEditorResultCopyMarkdownClickedEvent {
+ action: TelemetryActions.SQL_EDITOR_RESULT_COPY_MARKDOWN_CLICKED
+}
+
+/**
+ * Result copy JSON button clicked in the SQL editor.
+ *
+ * @group Events
+ * @source studio
+ * @page /dashboard/project/{ref}/sql
+ */
+export interface SqlEditorResultCopyJsonClickedEvent {
+ action: TelemetryActions.SQL_EDITOR_RESULT_COPY_JSON_CLICKED
+}