Guides / SaaS
You want to know the moment you hit 10 trial conversions in a day — either to celebrate as a team, trigger a marketing workflow, or update a growth dashboard. Smart Actions fires a webhook when the count crosses your threshold.
// Stripe webhook: customer.subscription.updated (trial_end → active)
if (event.type === "customer.subscription.updated") {
const sub = event.data.object;
const converted = sub.status === "active" && sub.trial_end && Date.now() / 1000 > sub.trial_end;
if (converted) {
await logit.now("conversions", {
event: "Trial converted to paid",
description: `Customer ${sub.customer} upgraded to ${sub.items.data[0]?.price.nickname ?? "paid"}`,
icon: "💰",
notify: true,
tags: { plan: sub.items.data[0]?.price.nickname ?? "unknown" },
metadata: {
subscriptionId: sub.id,
customerId: sub.customer,
mrr: sub.items.data[0]?.price.unit_amount,
},
});
}
}
| Field | Value |
|---|---|
| Name | 10 conversions today |
| Channel | conversions |
| Event name | Trial converted to paid |
| Threshold | 10 |
| Window | 24 hours |
| Cooldown | 24 hours |
| Action | Webhook |
| URL | Your internal API, Zapier, or n8n endpoint |
The 24-hour cooldown ensures the rule fires once per day — when you hit 10 conversions, you get one notification, not a cascade.
// Your webhook endpoint
export async function POST(req: Request) {
const body = await req.json();
// body.rule = "10 conversions today"
// body.eventCount = 10
// body.channel = "conversions"
// Send a Slack celebration message, update a Notion tracker, etc.
await postToSlack("#wins", `🎉 We hit 10 paid conversions today!`);
return Response.json({ ok: true });
}
mrr in metadata so you can query total MRR added when the webhook fires.Try LogIt free
7-day trial. No credit card required.