diff --git a/apps/dashboard/src/@/analytics/report.ts b/apps/dashboard/src/@/analytics/report.ts index 1f3352e90ea..f0a0246529a 100644 --- a/apps/dashboard/src/@/analytics/report.ts +++ b/apps/dashboard/src/@/analytics/report.ts @@ -435,11 +435,8 @@ export function reportPaymentLinkCreated(properties: { * ### Who is responsible for this event? * @greg */ -export function reportPaymentLinkBuySuccessful(properties: { - linkId: string; - clientId: string; -}) { - posthog.capture("payment link buy successful", properties); +export function reportPaymentLinkBuySuccessful() { + posthog.capture("payment link buy successful"); } /** @@ -451,8 +448,6 @@ export function reportPaymentLinkBuySuccessful(properties: { * @greg */ export function reportPaymentLinkBuyFailed(properties: { - linkId: string; - clientId: string; errorMessage: string; }) { posthog.capture("payment link buy failed", properties); diff --git a/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx b/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx index f52b2ed3aa4..58e4a73fe58 100644 --- a/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx +++ b/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx @@ -62,24 +62,16 @@ export function PayPageWidget({ image={image} name={name} onSuccess={() => { + reportPaymentLinkBuySuccessful(); + if (!redirectUri) return; const url = new URL(redirectUri); - if (paymentLinkId && clientId) { - reportPaymentLinkBuySuccessful({ - linkId: paymentLinkId, - clientId: clientId, - }); - } return window.open(url.toString()); }} onError={(error) => { - if (paymentLinkId && clientId) { - reportPaymentLinkBuyFailed({ - linkId: paymentLinkId, - clientId: clientId, - errorMessage: error.message, - }); - } + reportPaymentLinkBuyFailed({ + errorMessage: error.message, + }); }} paymentLinkId={paymentLinkId} purchaseData={purchaseData}