From 82c7c2b9201761521cdb33ed7fce24c21c15b5c9 Mon Sep 17 00:00:00 2001 From: Surbhi Date: Sun, 1 Dec 2024 19:09:20 -0500 Subject: [PATCH] Adding a posthog capture event when a proxy is created --- frontend/src/scenes/settings/environment/proxyLogic.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/scenes/settings/environment/proxyLogic.ts b/frontend/src/scenes/settings/environment/proxyLogic.ts index d18a07babbf61..1147abfa2c9e3 100644 --- a/frontend/src/scenes/settings/environment/proxyLogic.ts +++ b/frontend/src/scenes/settings/environment/proxyLogic.ts @@ -4,6 +4,7 @@ import { loaders } from 'kea-loaders' import api from 'lib/api' import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast' import { isDomain } from 'lib/utils' +import posthog from 'posthog-js' import { organizationLogic } from 'scenes/organizationLogic' import type { proxyLogicType } from './proxyLogicType' @@ -68,7 +69,10 @@ export const proxyLogic = kea([ listeners(({ actions, values }) => ({ collapseForm: () => actions.loadRecords(), deleteRecordFailure: () => actions.loadRecords(), - createRecordSuccess: () => actions.loadRecords(), + createRecordSuccess: () => { + actions.loadRecords() + posthog.capture('proxy_record_created') + }, maybeRefreshRecords: () => { if (values.shouldRefreshRecords) { actions.loadRecords()