Built for startups,
scaled for unicorns
Successfully submitted!
Error! Please try again
Understanding the long-term revenue impact of your referral program is essential for optimizing spend and proving ROI. While GrowSurf tracks referral sign-ups and conversions, combining that data with Stripe's subscription revenue gives you the complete picture β from initial referral click to monthly recurring revenue (MRR) contribution.
This guide shows you how to build a recurring referral revenue tracking system that connects GrowSurf referral data with Stripe subscription events. You'll learn how to attribute ongoing subscription revenue to the original referrer, calculate referral LTV, and build dashboards that show the true value of your referral program over time.
When a referred user becomes a Stripe customer, add metadata that links them back to their GrowSurf referrer. This is the foundation for all downstream revenue attribution.
CAMPAIGN_REFERRAL_CONVERTED webhookreferred_by, growsurf_referral_id, referral_dateConfigure Stripe webhooks to capture all revenue-related events for referred customers. This lets you attribute each payment back to the original referral.
invoice.paid, invoice.payment_succeeded, and customer.subscription.updatedCreate a database table that logs every payment from referred customers, linked to the original referrer. This becomes your source of truth for referral revenue reporting.
Build queries that calculate the lifetime value of referred customers compared to non-referred customers. This data proves the ROI of your referral program.
Update GrowSurf participant records with revenue data so you can see financial impact directly in GrowSurf's dashboard.
PUT /v2/campaign/{id}/participant/{participantId} with revenue metadataCreate scheduled reports that summarize referral program revenue performance for stakeholders.
// Tag referred customers in Stripe with referral metadata
async function tagReferredCustomer(stripeCustomerId, growsurfData) {
await stripe.customers.update(stripeCustomerId, {
metadata: {
referred_by: growsurfData.referredBy,
growsurf_referral_id: growsurfData.referralId,
growsurf_campaign_id: growsurfData.campaignId,
referral_date: new Date().toISOString()
}
});
}
// Track recurring revenue from referred customers
app.post('/api/stripe-invoice-webhook', async (req, res) => {
const event = req.body;
if (event.type === 'invoice.paid') {
const invoice = event.data.object;
// Get customer metadata to check if referred
const customer = await stripe.customers.retrieve(invoice.customer);
if (customer.metadata.referred_by) {
// Log revenue attribution
await db.referralRevenue.create({
referrerId: customer.metadata.referred_by,
customerId: customer.id,
invoiceId: invoice.id,
amount: invoice.amount_paid,
currency: invoice.currency,
period_start: invoice.period_start,
period_end: invoice.period_end,
created_at: new Date()
});
// Update GrowSurf with cumulative revenue
const totalRevenue = await db.referralRevenue.sum('amount', {
where: { referrerId: customer.metadata.referred_by }
});
await fetch(
`https://api.growsurf.com/v2/campaign/${CAMPAIGN_ID}/participant/${customer.metadata.referred_by}`,
{
method: 'PUT',
headers: {
'Authorization': `Bearer ${GROWSURF_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
metadata: {
total_referred_revenue: totalRevenue,
last_revenue_update: new Date().toISOString()
}
})
}
);
}
}
res.json({ received: true });
});Don't just look at total referral revenue β analyze it by monthly cohorts. This reveals trends in referral quality over time and helps you identify whether changes to your program are attracting higher or lower LTV customers.
Create alerts that notify your team when referral revenue hits milestones (e.g., total referral MRR crosses $10K). This keeps stakeholders engaged and helps you catch drops in referral revenue quickly.
Calculate your referral Customer Acquisition Cost by dividing total rewards paid out by the number of converted referrals. Compare this to your paid advertising CAC to quantify the efficiency of your referral program.
If a customer existed in Stripe before being referred, you can update their metadata after the referral is tracked in GrowSurf. Future invoices will be attributable. For historical accuracy, note the referral start date in metadata and only count revenue from that date forward.
Yes. The invoice.paid webhook fires for all subscriptions. Your revenue attribution table will capture each invoice separately, so multiple subscriptions from the same referred customer are all counted toward the referrer's total impact.
Stripe's customer.subscription.updated event includes the old and new plan details. Log these changes in your attribution table to track how referred customers' spending changes over time β this gives you accurate MRR attribution even as customers change plans.
Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies
