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

Conversation

surbhi-posthog
Copy link
Contributor

Problem

We want to add events when the features under the teams products are used. For example: managed_reverse_proxy, 2fa_enforcement etc.

in this PR, Im adding a capture event for only one feature managed_reverse_proxy. I will follow up the PR with adding events for the remaining features that include but are not limited to:

automatic_provisioning,
sso_enforcement,
2fa_enforcement,
priority_support etc.

Changes

Event is fired when a managed reverse proxy is created.
image

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Cloud: Yes
self-hosted: TBD

How did you test this code?

Tested locally on: http://localhost:8000/project/2/settings/organization-proxy

Created a managed reverse proxy and verified that an event was fired in the console.

Copy link
Contributor

github-actions bot commented Dec 2, 2024

Size Change: 0 B

Total Size: 1.16 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.16 MB

compressed-size-action

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.

@surbhi-posthog
Copy link
Contributor Author

Moved this logic to the backend here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants