Guides / Payments
A trial has three moments worth tracking: when it starts, when it expires (or is about to), and when it converts to paid. Logging all three gives you the full picture.
Call this when the user activates a trial:
const trialStart = await logit.now("trials", {
event: "Trial started",
description: `${user.email} started a 7-day trial`,
icon: "🎁",
notify: true,
tags: { plan: "pro" },
metadata: {
userId: user.id,
email: user.email,
trialEndsAt: trialEndDate.toISOString(),
},
});
Save trialStart.id as the trackingId for the timeline.
When the user upgrades (Stripe webhook customer.subscription.created):
await logit.now("trials", {
event: "Trial converted to paid 🎉",
description: `${user.email} upgraded to Pro`,
icon: "🎉",
notify: true,
trackingId: user.logitTrialTrackingId, // links to the trial start event
tags: { plan: "pro", converted: "true" },
metadata: { userId: user.id, email: user.email },
});
Run this from a cron job when trials expire:
for (const user of expiredTrialUsers) {
await logit.now("trials", {
event: "Trial expired — not converted",
description: user.email,
icon: "⏰",
notify: false,
trackingId: user.logitTrialTrackingId,
tags: { plan: "free", converted: "false" },
metadata: { userId: user.id, email: user.email },
});
}
In your LogIt inbox, each trial appears as a timeline: Started → (Converted or Expired). Filter by converted: "true" to see conversion rate at a glance.
Try LogIt free
7-day trial. No credit card required.