Skip to content

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

feat(sql-editor): telemetry for ai suggestion create events

Greg Richardsonf6240a2db8d4
diff --git a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
index 9a35c2b366a..7542641a3ce 100644
--- a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
+++ b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx
@@ -182,6 +182,16 @@ const SQLTemplates = observer(() => {
})
await handleNewQuery(formattedSql, title)
+
+ Telemetry.sendEvent(
+ {
+ category: 'sql_editor',
+ action: 'ai_suggestion_created',
+ label: 'create_snippet',
+ },
+ telemetryProps,
+ router
+ )
} catch (error: unknown) {
if (isError(error)) {
ui.setNotification({