Built for startups,
scaled for unicorns
Successfully submitted!
Error! Please try again
HubSpot CRM is where your sales and marketing teams live β so your referral data should be there too. By integrating GrowSurf with HubSpot, you can automatically sync referral participant data to HubSpot contacts, giving your team complete visibility into which leads came from referrals and who referred them.
This guide walks you through connecting GrowSurf referral events to HubSpot CRM using webhooks and HubSpot's API. You'll learn how to create custom contact properties for referral data, automatically update contacts when they're referred, and build HubSpot lists and reports filtered by referral source. The result is a unified view of your referral program's impact on your sales pipeline.
Before syncing data, create custom properties in HubSpot to store referral information on contact records.
referral_source (Single-line text) β stores "growsurf"referred_by_email (Single-line text) β the referrer's emailreferral_code (Single-line text) β the participant's unique referral codereferral_status (Dropdown) β options: Participant, Referred, Convertedreferral_date (Date picker) β when the referral occurredtotal_referrals_made (Number) β count of successful referralsConfigure GrowSurf to send webhook events when participants are created, referrals happen, and conversions occur.
PARTICIPANT_CREATED, PARTICIPANT_REFERRED, CAMPAIGN_REFERRAL_CONVERTEDCreate a server-side endpoint that receives GrowSurf events and creates or updates HubSpot contacts with referral data.
Define the data mapping between GrowSurf participant fields and HubSpot contact properties.
participant.email to HubSpot contact email (primary identifier)participant.referralCode to referral_codeparticipant.referredBy to referred_by_emailtotal_referrals_madereferral_status based on the event typeCreate active lists in HubSpot that automatically segment contacts by their referral activity.
referral_source = growsurf)referred_by_email is known)total_referrals_made > 5)Build custom reports in HubSpot to visualize referral program performance alongside your other marketing channels.
referral_source// Sync GrowSurf referral data to HubSpot CRM
const hubspot = require('@hubspot/api-client');
const hubspotClient = new hubspot.Client({ accessToken: process.env.HUBSPOT_TOKEN });
app.post('/api/growsurf-to-hubspot', async (req, res) => {
const { event, participant, referrer } = req.body;
const contactProperties = {
email: participant.email,
firstname: participant.firstName || '',
lastname: participant.lastName || '',
referral_source: 'growsurf',
referral_code: participant.referralCode,
referral_date: new Date().toISOString().split('T')[0]
};
if (event === 'PARTICIPANT_REFERRED' && referrer) {
contactProperties.referred_by_email = referrer.email;
contactProperties.referral_status = 'Referred';
} else if (event === 'CAMPAIGN_REFERRAL_CONVERTED') {
contactProperties.referral_status = 'Converted';
} else {
contactProperties.referral_status = 'Participant';
}
try {
// Try to update existing contact
await hubspotClient.crm.contacts.basicApi.update(
participant.email,
{ properties: contactProperties, idProperty: 'email' }
);
} catch (e) {
if (e.code === 404) {
// Create new contact
await hubspotClient.crm.contacts.basicApi.create({
properties: contactProperties
});
}
}
// Update referrer's referral count
if (referrer) {
const referralCount = referrer.referralCount || 1;
await hubspotClient.crm.contacts.basicApi.update(
referrer.email,
{ properties: { total_referrals_made: referralCount.toString() }, idProperty: 'email' }
);
}
res.json({ success: true });
});Create HubSpot workflows triggered by the referral_status property changing to "Referred." Send a personalized welcome email that acknowledges they were referred and highlights special onboarding offers β referred leads convert better when they feel the personal connection.
Don't just push data from GrowSurf to HubSpot β also update GrowSurf when HubSpot deal stages change. This lets GrowSurf trigger reward fulfillment when a referred contact becomes a customer in your HubSpot pipeline.
Set the hs_analytics_source property to a custom value for referral contacts so they appear correctly in HubSpot's built-in attribution reports alongside organic, paid, and social sources.
GrowSurf offers a native HubSpot integration that handles basic contact syncing automatically. However, building a custom webhook integration gives you more control over which fields are synced, how data is mapped, and when updates occur. Use the native integration for simple setups and custom webhooks for advanced requirements.
Always search for an existing contact by email before creating a new one. HubSpot's API returns a 409 conflict error if a contact with that email exists. Use the update-or-create pattern shown in the code example to handle both cases gracefully.
Yes. Include the GrowSurf campaign ID in the contact properties. Create a custom property called referral_campaign_id and populate it from the webhook payload's campaign data. This lets you segment contacts by specific referral campaigns.
Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies
