Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding a posthog capture event when a billing proxy is created #26562

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/src/scenes/settings/environment/proxyLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -68,7 +69,10 @@ export const proxyLogic = kea<proxyLogicType>([
listeners(({ actions, values }) => ({
collapseForm: () => actions.loadRecords(),
deleteRecordFailure: () => actions.loadRecords(),
createRecordSuccess: () => actions.loadRecords(),
createRecordSuccess: () => {
actions.loadRecords()
posthog.capture('proxy_record_created')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the event name to follow the lowercase sentence case pattern we use? We should be more specific - maybe something like managed proxy record created.

I forgot to mention this but Raquel has been working on moving these events to the backend so ad blockers won't block them. Any crud operations where the events happen on the backup are good candidates for that. Do you want to take a stab at doing this on on the backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes for sure! I'm assuming that we can just abandon this frontend change and add the log solely in the backend. Let me know if I'm missing anything

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's probably easiest. Apologies for missing that context.

},
maybeRefreshRecords: () => {
if (values.shouldRefreshRecords) {
actions.loadRecords()
Expand Down
Loading