Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📈 Track license purchase

Luke Vellabc76ff06fbb2
diff --git a/apps/web/src/app/api/stripe/webhook/handlers/checkout/completed.ts b/apps/web/src/app/api/stripe/webhook/handlers/checkout/completed.ts
index 6cfacb9e2..d6b560a97 100644
--- a/apps/web/src/app/api/stripe/webhook/handlers/checkout/completed.ts
+++ b/apps/web/src/app/api/stripe/webhook/handlers/checkout/completed.ts
@@ -69,6 +69,19 @@ async function handleSelfHostedCheckoutSessionCompleted(
seats,
});
+ posthog?.capture({
+ distinctId: email,
+ event: "license_purchase",
+ properties: {
+ licenseType,
+ seats,
+ version,
+ $set: {
+ tier: licenseType,
+ },
+ },
+ });
+
if (!license || !license.data) {
throw new Error(
`Failed to create license for session: ${checkoutSession.id} - ${license?.error}`,