Skip to content

Commit 9f2ee67

Browse files
committed
Add analytics to subtasks
1 parent c5bd634 commit 9f2ee67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/web_ui/src/routes/(app)/settings/manage_tools/[project_id]/add_tools/kiln_task/add_kiln_task_tool.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import SavedRunConfigurationsDropdown from "$lib/ui/run_config_component/saved_run_configs_dropdown.svelte"
1414
import RunConfigComponent from "$lib/ui/run_config_component/run_config_component.svelte"
1515
import { tool_name_validator } from "$lib/utils/input_validators"
16+
import posthog from "posthog-js"
1617
1718
let error: KilnError | null = null
1819
let submitting = false
@@ -156,12 +157,14 @@
156157
goto(`/settings/create_task/${project_id}`)
157158
}
158159
160+
let created_run_config_in_page = false
159161
async function create_new_run_config() {
160162
loading = true
161163
if (run_config_component) {
162164
const saved_run_config = await run_config_component.save_new_run_config()
163165
if (saved_run_config?.id) {
164166
selected_run_config_id = saved_run_config.id
167+
created_run_config_in_page = true
165168
}
166169
}
167170
loading = false
@@ -226,6 +229,11 @@
226229
227230
// Delete the project_id from the available_tools, so next load it loads the updated list.
228231
uncache_available_tools($page.params.project_id)
232+
233+
posthog.capture("added_kiln_task_tool", {
234+
created_run_config_in_page: created_run_config_in_page,
235+
})
236+
229237
// Navigate to the manage tools page for the created tool
230238
goto(`/settings/manage_tools/${$page.params.project_id}/kiln_task_tools`)
231239
} catch (e) {

0 commit comments

Comments
 (0)