From 2c63366c7985863c8483495a631c6e1f6036fa34 Mon Sep 17 00:00:00 2001 From: Mauricio Araujo Date: Wed, 3 Apr 2024 12:09:43 -0400 Subject: [PATCH] Add user context to payment method analytics (#4498) --- api/server/handlers/billing/create.go | 4 ++++ api/server/handlers/billing/delete.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/api/server/handlers/billing/create.go b/api/server/handlers/billing/create.go index 74e54a7b41..9f7f754250 100644 --- a/api/server/handlers/billing/create.go +++ b/api/server/handlers/billing/create.go @@ -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, "") diff --git a/api/server/handlers/billing/delete.go b/api/server/handlers/billing/delete.go index ccb107ceee..2a3c4c0368 100644 --- a/api/server/handlers/billing/delete.go +++ b/api/server/handlers/billing/delete.go @@ -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, "")