Built for startups,
scaled for unicorns
Successfully submitted!
Error! Please try again
Customer.io's event-driven architecture is purpose-built for the kind of real-time, contextual messaging that referral programs need. Instead of batch campaigns, Customer.io lets you trigger individual emails based on specific actions β making it ideal for instant referral notifications, personalized milestone celebrations, and timely re-engagement prompts.
This guide covers connecting GrowSurf referral events to Customer.io, building triggered campaigns for each stage of the referral journey, and using Customer.io's segmentation and A/B testing features to optimize your referral email performance.
Send GrowSurf referral events to Customer.io so they can trigger campaigns and workflows.
referral_program_joinedreferral_madereferral_convertedreferral_reward_earnedCreate a Customer.io campaign that welcomes new referral program participants.
total_referrals > 0Send instant notifications when referral events happen.
Trigger celebration emails when referrers hit specific milestones.
total_referralsCreate a targeted email sequence for people who were referred.
referred_by attribute is setUse Customer.io's analytics to measure and improve referral email performance.
// Send GrowSurf events to Customer.io Track API
const { TrackClient, RegionUS } = require('customerio-node');
const cio = new TrackClient(
process.env.CIO_SITE_ID,
process.env.CIO_API_KEY,
{ region: RegionUS }
);
app.post('/api/growsurf-to-customerio', async (req, res) => {
const { event, participant, referrer } = req.body;
// Identify/update the participant in Customer.io
await cio.identify(participant.email, {
email: participant.email,
first_name: participant.firstName || '',
last_name: participant.lastName || '',
referral_code: participant.referralCode,
referral_link: participant.shareUrl,
referral_status: 'active',
total_referrals: participant.referralCount || 0,
referred_by: referrer?.email || '',
referral_program_join_date: Math.floor(Date.now() / 1000)
});
// Track the referral event
const eventMap = {
'PARTICIPANT_CREATED': 'referral_program_joined',
'PARTICIPANT_REFERRED': 'referral_made',
'CAMPAIGN_REFERRAL_CONVERTED': 'referral_converted',
'PARTICIPANT_REACHED_REWARD': 'referral_reward_earned'
};
const cioEvent = eventMap[event];
if (cioEvent) {
await cio.track(participant.email, {
name: cioEvent,
data: {
referral_code: participant.referralCode,
referrer_email: referrer?.email,
referrer_name: referrer?.firstName,
referral_count: participant.referralCount || 0,
timestamp: Math.floor(Date.now() / 1000)
}
});
}
// Also update the referrer's profile if applicable
if (referrer) {
await cio.identify(referrer.email, {
total_referrals: referrer.referralCount || 0,
last_referral_date: Math.floor(Date.now() / 1000)
});
}
res.json({ success: true });
});Customer.io supports Liquid templating in emails. Use it to show dynamic referral stats: You've referred {{customer.total_referrals}} friends so far! and conditional content based on referral tier. This creates personalized emails without needing separate templates for each tier.
Define conversion goals in Customer.io (e.g., "made a referral within 7 days of receiving email") to measure actual email impact on referral behavior. This is more meaningful than open/click rates because it tells you if the email actually drove the desired action.
If you're already using Segment for your data pipeline, connect Segment as a Customer.io source. This means your GrowSurf events flow through Segment to Customer.io automatically, without building a separate integration. One event pipeline powers both analytics and email.
Customer.io is event-driven by design β every email is triggered by a specific action, not sent to a batch list. This makes it ideal for referral programs where you need instant, contextual emails ("Your friend just signed up!"). Mailchimp is better for campaign-style emails to segments. Klaviyo is strong for e-commerce and also supports events well.
You can use Zapier to connect GrowSurf to Customer.io without coding. Set up a Zap that triggers on GrowSurf events and uses Customer.io's Zapier actions to track events and update customer profiles. This is simpler than custom code but may have a slight delay compared to direct API integration.
Use Customer.io's campaign-level suppression and frequency capping. Set rules like "don't send if already received a referral email in the last 24 hours" to prevent email fatigue. You can also use segments to exclude contacts who are currently active in another campaign.
Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies
