Skip to content

Commit 8600b28

Browse files
committed
Dashboard: Fix Payment link buy completion tracking
1 parent 572368e commit 8600b28

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

apps/dashboard/src/@/analytics/report.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,8 @@ export function reportPaymentLinkCreated(properties: {
435435
* ### Who is responsible for this event?
436436
* @greg
437437
*/
438-
export function reportPaymentLinkBuySuccessful(properties: {
439-
linkId: string;
440-
clientId: string;
441-
}) {
442-
posthog.capture("payment link buy successful", properties);
438+
export function reportPaymentLinkBuySuccessful() {
439+
posthog.capture("payment link buy successful");
443440
}
444441

445442
/**
@@ -451,8 +448,6 @@ export function reportPaymentLinkBuySuccessful(properties: {
451448
* @greg
452449
*/
453450
export function reportPaymentLinkBuyFailed(properties: {
454-
linkId: string;
455-
clientId: string;
456451
errorMessage: string;
457452
}) {
458453
posthog.capture("payment link buy failed", properties);

apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,16 @@ export function PayPageWidget({
6262
image={image}
6363
name={name}
6464
onSuccess={() => {
65+
reportPaymentLinkBuySuccessful();
66+
6567
if (!redirectUri) return;
6668
const url = new URL(redirectUri);
67-
if (paymentLinkId && clientId) {
68-
reportPaymentLinkBuySuccessful({
69-
linkId: paymentLinkId,
70-
clientId: clientId,
71-
});
72-
}
7369
return window.open(url.toString());
7470
}}
7571
onError={(error) => {
76-
if (paymentLinkId && clientId) {
77-
reportPaymentLinkBuyFailed({
78-
linkId: paymentLinkId,
79-
clientId: clientId,
80-
errorMessage: error.message,
81-
});
82-
}
72+
reportPaymentLinkBuyFailed({
73+
errorMessage: error.message,
74+
});
8375
}}
8476
paymentLinkId={paymentLinkId}
8577
purchaseData={purchaseData}

0 commit comments

Comments
 (0)