Skip to content

Commit

Permalink
Add user context to payment method analytics (#4498)
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAraujo authored Apr 3, 2024
1 parent 13e05e6 commit 2c63366
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/server/handlers/billing/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func (c *SetDefaultBillingHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ

_ = c.Config().AnalyticsClient.Track(analytics.PaymentMethodAttachedTrack(&analytics.PaymentMethodCreateDeleteTrackOpts{
ProjectScopedTrackOpts: analytics.GetProjectScopedTrackOpts(user.ID, proj.ID),
Email: user.Email,
FirstName: user.FirstName,
LastName: user.LastName,
CompanyName: user.CompanyName,
}))

c.WriteResult(w, r, "")
Expand Down
4 changes: 4 additions & 0 deletions api/server/handlers/billing/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func (c *DeleteBillingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

_ = c.Config().AnalyticsClient.Track(analytics.PaymentMethodDettachedTrack(&analytics.PaymentMethodCreateDeleteTrackOpts{
ProjectScopedTrackOpts: analytics.GetProjectScopedTrackOpts(user.ID, proj.ID),
Email: user.Email,
FirstName: user.FirstName,
LastName: user.LastName,
CompanyName: user.CompanyName,
}))

c.WriteResult(w, r, "")
Expand Down

0 comments on commit 2c63366

Please sign in to comment.