Guides / SaaS

Get Alerted When Churn Events Cluster

4 min read·SaaS

Why Clustering Matters

One cancellation is expected. Three cancellations in an hour after a deploy is a sign your new release broke something — or your pricing page just updated with a bug. Smart Actions detects the cluster, not the individual event.

Step 1: Log Churn Events

ts
// Stripe webhook: customer.subscription.deleted
if (event.type === "customer.subscription.deleted") {
  const sub = event.data.object;
  await logit.now("churn", {
    event: "Subscription cancelled",
    description: `Customer ${sub.customer} cancelled ${sub.items.data[0]?.price.nickname ?? "plan"}`,
    icon: "😢",
    notify: true,         // notify on every cancellation AND watch the threshold
    tags: {
      plan: sub.items.data[0]?.price.nickname ?? "unknown",
      reason: sub.cancellation_details?.reason ?? "none",
    },
    metadata: {
      subscriptionId: sub.id,
      customerId: sub.customer,
      mrr: sub.items.data[0]?.price.unit_amount,
    },
  });
}

Step 2: Create the Churn Cluster Rule

FieldValue
NameChurn cluster
Channelchurn
Event nameSubscription cancelled
Threshold3
Window1 hour
Cooldown6 hours
ActionPush notification
Push title🚨 Churn cluster detected
Push body3+ cancellations in 1 hour — investigate

Step 3: Add a Webhook for Team Notification

Create a second action using the Webhook type to post into your #churn Slack channel so the whole team sees it, not just the person with the app.

Tips

  • Keep notify: true on individual events so you still see each cancellation, but use Smart Actions for the pattern.
  • Track downgrades in a separate downgrades channel and add its own rule — they're often a leading indicator of full churn.
  • A 6-hour cooldown prevents alert fatigue during a bad day without hiding new clusters.

Try LogIt free

7-day trial. No credit card required.

Start free