← View All Guides
HubSpot logo
Integration Guide

How to Attribute Deals to Referrals in HubSpot with GrowSurf

Track which deals in your HubSpot pipeline were sourced from referrals and measure referral program revenue impact.

When your referral program generates leads, you need to track those leads all the way through your sales pipeline to the closed deal. HubSpot deal attribution lets you connect the dots between a GrowSurf referral and the revenue it generates, giving you clear ROI metrics for your referral program.

This guide shows you how to automatically attribute HubSpot deals to their referral source using GrowSurf data. You'll learn how to create referral-attributed deals, track them through your pipeline stages, and build revenue reports that prove the financial impact of your referral program to stakeholders.

Integration Steps

Step 1: Create Custom Deal Properties for Referral Attribution

Add custom properties to your HubSpot deal records that link each deal back to its referral source.

  • Go to Settings > Properties > Deal Properties
  • Create a "Referral Attribution" property group
  • Add properties:
    • deal_referral_source (Dropdown: GrowSurf, Partner, Organic)
    • deal_referrer_email (Single-line text)
    • deal_referrer_name (Single-line text)
    • deal_referral_id (Single-line text β€” GrowSurf referral ID)
    • deal_referral_campaign (Single-line text)

Step 2: Auto-Create Deals from Referral Conversions

When a referred contact converts in GrowSurf, automatically create a deal in HubSpot associated with that contact.

  • Listen for GrowSurf's CAMPAIGN_REFERRAL_CONVERTED webhook
  • Use HubSpot's Deals API to create a new deal
  • Associate the deal with the referred contact and the referrer contact
  • Set the deal stage to your initial pipeline stage (e.g., "Qualified Lead")
  • Populate all referral attribution properties

Step 3: Associate Referrers as Deal Collaborators

Link the referrer as an associated contact on the deal so your sales team can see who made the referral and potentially involve them in the sales process.

  • Use HubSpot's Associations API to link the referrer contact to the deal
  • Add a custom association label like "Referrer" to distinguish from the primary contact
  • This gives sales reps context about the relationship and potential warm introductions

Step 4: Build a Referral Pipeline Report

Create a HubSpot report that shows referral-attributed deals at each pipeline stage, giving you a visual funnel for referral revenue.

  • Go to Reports > Create Report > Custom Report Builder
  • Filter deals where deal_referral_source equals "GrowSurf"
  • Group by pipeline stage to see the referral deal funnel
  • Add deal amount as the measure to show revenue at each stage
  • Save to your referral program dashboard

Step 5: Compare Referral Deal Metrics to Other Sources

Build comparison reports that show how referral deals perform against other lead sources.

  • Create a report comparing average deal size by deal_referral_source
  • Track average time-to-close for referral deals vs. outbound or inbound deals
  • Compare win rates across lead sources
  • Calculate referral deal CAC by dividing total referral rewards by deals won

Step 6: Trigger Referrer Rewards on Deal Close

When a referral-attributed deal is marked as "Closed Won" in HubSpot, automatically trigger the referrer's reward in GrowSurf.

  • Create a HubSpot workflow triggered by deal stage changing to "Closed Won"
  • Add a branch checking if deal_referral_source = "GrowSurf"
  • Use a webhook action to call your server, which then calls GrowSurf's API to trigger the reward
  • Mark the referral as converted in GrowSurf using POST /v2/campaign/{id}/participant/{participantId}/convert

Code Snippets

// Create a referral-attributed deal in HubSpot
async function createReferralDeal(referredContact, referrer, referralData) {
  // Create the deal
  const deal = await hubspotClient.crm.deals.basicApi.create({
    properties: {
      dealname: `Referral: ${referredContact.email}`,
      pipeline: 'default',
      dealstage: 'qualifiedtobuy',
      amount: '',
      deal_referral_source: 'GrowSurf',
      deal_referrer_email: referrer.email,
      deal_referrer_name: `${referrer.firstName} ${referrer.lastName}`,
      deal_referral_id: referralData.referralId,
      deal_referral_campaign: referralData.campaignId
    }
  });

  // Associate deal with the referred contact
  await hubspotClient.crm.deals.associationsApi.create(
    deal.id, 'contacts', referredContact.hubspotId,
    [{ associationCategory: 'HUBSPOT_DEFINED', associationTypeId: 3 }]
  );

  // Associate deal with the referrer contact
  await hubspotClient.crm.deals.associationsApi.create(
    deal.id, 'contacts', referrer.hubspotId,
    [{ associationCategory: 'USER_DEFINED', associationTypeId: 'referrer' }]
  );

  return deal;
}

// Webhook from HubSpot when deal closes
app.post('/api/hubspot-deal-closed', async (req, res) => {
  const { dealId, properties } = req.body;

  if (properties.deal_referral_source === 'GrowSurf') {
    // Trigger reward in GrowSurf
    const referralId = properties.deal_referral_id;
    await fetch(
      `https://api.growsurf.com/v2/campaign/${CAMPAIGN_ID}/participant/${referralId}/convert`,
      {
        method: 'POST',
        headers: { 'Authorization': `Bearer ${GROWSURF_API_KEY}` }
      }
    );
  }
  res.json({ success: true });
});

Tips

Use Deal Attribution for Executive Reporting

Nothing proves referral program ROI better than showing actual closed revenue attributed to referrals. Build a monthly executive report that shows total referral pipeline value, closed referral revenue, and referral deal win rates compared to other channels.

Involve the Referrer in Enterprise Deals

For high-value B2B deals, consider looping the referrer into the sales process. They can provide warm introductions, share their experience with the prospect, and help overcome objections. Your sales team can see the referrer's contact info directly on the deal record.

Set Up Revenue-Based Referral Rewards

Instead of flat rewards, tie referral rewards to deal value. Use the HubSpot deal amount to calculate percentage-based rewards (e.g., 10% of first-year contract value) and trigger the appropriate reward tier in GrowSurf when the deal closes.

FAQ

How do I handle referral attribution when multiple touches influence a deal?

Use HubSpot's multi-touch attribution if available on your plan. Set the referral as the "first touch" or "originating source" while still crediting other marketing touches. The deal_referral_source property preserves the referral attribution regardless of other interactions.

Can I attribute a deal to a referral after it's already been created?

Yes. If a deal was created before the referral data was synced, you can update the deal's referral properties via HubSpot's API or manually in the UI. Just update the custom properties with the referrer's information and GrowSurf referral ID.

What if a referred contact creates multiple deals β€” do all get attributed to the referral?

That depends on your business rules. You can either attribute all deals from a referred contact to the original referrer, or only attribute the first deal. Implement your chosen rule in the deal creation logic by checking if a referral-attributed deal already exists for that contact.

Set up your refer a friend program with customer referral and affiliate program software that lowers your acquisition costs, increases customer loyalty, and saves you gobs of time.

Trusted by marketing and product teams at fast-growing B2C, fintech, and SaaS companies