RevenueCat trial conversion tracking that adds up
RevenueCat trial conversion tracking that adds up: why 5,208 conversions went untracked, and the identity, event time and RENEWAL fixes that corrected Mixpanel.
By Hamza Ghouri
If your RevenueCat trial conversion tracking disagrees with the store, the dashboard is usually counting the wrong event. On a fitness app I run the backend for, subscription events flow from RevenueCat webhooks into Mixpanel. When I checked the "Trial Converted to Paid" chart against the raw data, 5,208 real conversions had never been tracked, and most of the 776 events that had fired were not trial conversions at all. Three separate bugs were stacked: identity, event time and the event that defines a conversion. This post goes through each one and the checks I ran before trusting the new numbers.
Two Mixpanel profiles for every subscriber
The app called Mixpanel's identify() with the numeric user id. The backend sent its events keyed on the user's email. So the same person became two Mixpanel profiles: one with all the app activity, one with all the subscription events. From the app's side, subscription events looked like they were firing for nobody.
The fix was one rule: every server-side event sends distinct_id as the numeric user id, the same value the app identifies with. I built that into a single helper that all nine backend events go through, so a new event cannot pick a different key by accident. Mixpanel's identity management docs explain how distinct_id ties events to a user, and the short version is that every source must agree on it.
Events stamped when they arrived, not when they happened
The backend sent the event time as a property called timestamp. Mixpanel ignores that name for timing. Its reserved field is time, and when no time is provided, Mixpanel uses the moment the event was ingested.
So every event was stamped when it reached Mixpanel. For live app events the gap is small. For webhooks it is wrong in exactly the cases you care about: webhooks that arrive late, and webhooks you replay after an outage, would all land on the replay date. Renaming the property to time fixed it.
How does RevenueCat report a trial conversion?
RevenueCat reports a trial converting to paid as a RENEWAL event, not an INITIAL_PURCHASE. The subscription renews out of its trial period, and the new period's period_type is NORMAL where the trial's was TRIAL. RevenueCat's event types and fields reference also documents an is_trial_conversion flag on RENEWAL events, and says trial conversions count as renewals.
Why the chart counted the wrong people
The backend tracked "Trial Converted to Paid" on INITIAL_PURCHASE. That event fires when someone starts a subscription, which includes starting a trial and also includes paying straight away with no trial at all.
Against the current data, the gap was large:
- 5,208 real conversions went untracked, because they arrived as
RENEWALevents. - 776 events fired from
INITIAL_PURCHASEinstead. - Of those 776, 309 were users who had never held a trial at all.
- 449 were lapsed users resubscribing months later.
A chart built on that event was measuring "new paid subscription starts", with some noise, and calling it trial conversion.
RevenueCat trial conversion tracking: define the event
The event now fires only on the first paid charge after a trial, and only when that charge lands before the trial lapsed. Someone whose trial expired and who came back much later is a resubscribe, which is a different and useful event, but not a trial conversion. That window check drops 397 late resubscribes, one of them 514 days after the trial ended.
There was one more field to fix. The event carried a conversion_day, meant to show how far into the trial people convert. It was measured from when the webhook was processed, so it was structurally always 1. Webhook lag averaged 0.002 days across all 776 events, which tells you nothing about the trial. It now counts from the trial start.
Here is the shape of the logic, simplified, with the trial dates loaded from our own records:
const DAY_MS = 24 * 60 * 60 * 1000;
if (event.type === "RENEWAL" && event.period_type === "NORMAL" && trial) {
const paidAt = event.purchased_at_ms;
const isFirstPaidCharge = !trial.convertedAt;
const beforeLapse = paidAt <= trial.expiresAtMs;
if (isFirstPaidCharge && beforeLapse) {
mixpanel.track("Trial Converted to Paid", {
distinct_id: String(user.id),
time: Math.floor(paidAt / 1000),
conversion_day: Math.floor((paidAt - trial.startedAtMs) / DAY_MS) + 1,
});
}
}
The + 1 makes the count inclusive, so a charge at the very end of a 7-day trial reports day 8. That was a deliberate choice, and I checked it against a real account at that boundary.
Checking the numbers before trusting them
I did not ship the new definition on the strength of reading it. I ran it against real accounts first:
- A 7-day boundary conversion reports day 8, as designed.
- Resubscribes 183 and 314 days after expiry are rejected.
- Across the data, the expectation is roughly 5,217 conversions where the old chart had 776, averaging day 12.4.
Historical Mixpanel data is unaffected by the change. The fix applies to new events only, so expect a step in the chart at the deploy date, and tell whoever reads it before they mistake it for a jump in conversions.
Trial events also drive email
Webhook events are good triggers for lifecycle email, as long as you read the event and not a cached flag. When a user cancels during a trial, RevenueCat sends a CANCELLATION with period_type TRIAL. That now sends a personal win-back note from the founder instead of the generic cancellation email, so the mailer gained reply-to and from-name overrides.
The trigger is the event field, not a trialing flag on the users table. That flag is never cleared when a trial lapses, so all 516 rows currently carrying it are stale. Any logic built on it would email people whose trials ended long ago.
The same pass caught a template bug: the auto-renewal email said "successfully renewed on" a date, but passed the expiry date, so a July renewal displayed August. The template field is now named for what it holds, the renewal date.
If you send email from webhooks, make the sends idempotent; I wrote about that in abandoned cart reminder emails that never double-send. The webhook route itself needs authentication, covered in webhook security for in-app purchases.
Where I'd start
- Pick one subscriber and find them in Mixpanel. If their app events and subscription events sit on two profiles, fix
distinct_idfirst. - Send event times as
time, from the webhook's own timestamps. - Track trial conversions on
RENEWALout of a trial, inside the trial window, and count the conversion day from the trial start. - Compare the new count with the store's own reports before anyone makes a decision from the chart.
More notes from the same backend are in how I scaled a fitness platform to 60,000 users. If your subscription analytics do not add up, it is the kind of work I do through my services.