Built for startups,
scaled for unicorns
Successfully submitted!
Error! Please try again
Salesforce Campaigns are the standard way to measure marketing program effectiveness β and your referral program should be tracked as a campaign alongside email, paid ads, and events. By connecting GrowSurf referral data to Salesforce Campaign Members, you get a unified view of how referrals stack up against your other marketing channels.
This guide shows you how to create a Salesforce Campaign for your referral program, automatically add referred leads as Campaign Members, track member status progression, and build campaign ROI reports that prove the value of your referral program to marketing leadership.
Set up a dedicated Salesforce Campaign to track all referral program activity.
When GrowSurf generates a referral, automatically add the referred lead to your Salesforce Campaign.
POST /services/data/v58.0/sobjects/CampaignMemberCampaignId, LeadId, and initial Status to "Referred"As the referral progresses through your funnel, update the Campaign Member status to reflect their journey.
CAMPAIGN_REFERRAL_CONVERTED eventPATCH /services/data/v58.0/sobjects/CampaignMember/{id}When a referred lead converts to an opportunity, Salesforce automatically associates the Campaign with the Opportunity for revenue attribution.
Create reports that show referral campaign performance alongside your other marketing campaigns.
If you run multiple GrowSurf campaigns, organize them as child campaigns under a parent "Referral Programs" campaign.
ParentId field// Add referred lead to Salesforce Campaign
async function addToCampaign(leadId, campaignId, referrerEmail) {
const campaignMember = await conn.sobject('CampaignMember').create({
CampaignId: campaignId,
LeadId: leadId,
Status: 'Referred',
Description: `Referred by: ${referrerEmail}`
});
return campaignMember;
}
// Update campaign member status on conversion
async function updateCampaignMemberStatus(leadId, campaignId, newStatus) {
// Find the campaign member
const result = await conn.query(
`SELECT Id FROM CampaignMember WHERE LeadId = '${leadId}' AND CampaignId = '${campaignId}'`
);
if (result.records.length > 0) {
await conn.sobject('CampaignMember').update({
Id: result.records[0].Id,
Status: newStatus,
FirstRespondedDate: new Date().toISOString()
});
}
}
// Full webhook handler
app.post('/api/growsurf-campaign-attribution', async (req, res) => {
const { event, participant, referrer } = req.body;
await conn.login(process.env.SF_USERNAME, process.env.SF_PASSWORD + process.env.SF_TOKEN);
const SF_CAMPAIGN_ID = process.env.SF_REFERRAL_CAMPAIGN_ID;
if (event === 'PARTICIPANT_REFERRED') {
// Create lead and add to campaign
const lead = await createReferralLead(participant, referrer);
await addToCampaign(lead.id, SF_CAMPAIGN_ID, referrer.email);
} else if (event === 'CAMPAIGN_REFERRAL_CONVERTED') {
const leads = await conn.query(
`SELECT Id FROM Lead WHERE GrowSurf_Participant_ID__c = '${participant.id}'`
);
if (leads.records.length > 0) {
await updateCampaignMemberStatus(leads.records[0].Id, SF_CAMPAIGN_ID, 'Converted');
}
}
res.json({ success: true });
});Enter the total cost of your referral program (rewards paid, platform fees, development costs) as the Campaign's Budgeted Cost. This enables Salesforce's built-in campaign ROI formula to calculate accurate return on investment for your referral channel.
Enable Salesforce Campaign Influence (available in Enterprise edition) to track referral program influence alongside other campaigns that touched the same opportunity. This gives a more accurate picture when referral leads also interact with other marketing campaigns.
Create new child campaigns each quarter (e.g., "GrowSurf Referrals - Q1 2026") to track performance trends over time. The parent campaign aggregates all-time metrics while child campaigns show quarterly performance.
Lead Source is a single field on the Lead object (e.g., "Referral"). Campaign Attribution tracks which specific campaigns influenced a deal, with support for multiple campaigns and revenue attribution. Use both: set Lead Source to "Referral" and add the lead to a referral Campaign for full tracking.
Yes. Add both to the Campaign with different statuses. The referrer could have status "Referrer" (a custom status you create) while the referred lead starts as "Referred." This lets you track total program participation including referrers.
With Customizable Campaign Influence, you can assign percentage weights to each campaign that influenced a deal. Set your referral campaign's influence percentage based on how strongly you believe referrals drive conversions vs. other touches β typically 40-60% for the primary referral source.
Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies
