← View All Guides
Google Analytics logo
Integration Guide

How to Track Referrals in Google Analytics with GrowSurf

Set up referral program tracking in Google Analytics to measure referral traffic, conversions, and campaign performance.

Google Analytics is the foundation of web analytics for most businesses β€” and your referral program's performance should be visible alongside your other traffic sources and marketing channels. By properly integrating GrowSurf with Google Analytics, you can track referral link clicks as a distinct traffic source, measure conversion rates for referred visitors, and compare referral channel performance against paid ads, organic search, and social media.

This guide covers setting up UTM-based referral tracking, configuring custom events for referral actions, building Google Analytics segments for referred visitors, and creating dashboards that show your referral program's contribution to overall traffic and conversions.

Integration Steps

Step 1: Configure UTM Parameters on GrowSurf Referral Links

Set up UTM parameters on your GrowSurf referral links so Google Analytics can properly attribute traffic.

  • In GrowSurf, go to Campaign > Settings > Sharing
  • Configure the referral link format to include UTM parameters:
    • utm_source=growsurf
    • utm_medium=referral
    • utm_campaign=referral-program (or your campaign name)
    • utm_content={{referralCode}} (tracks individual referrer)
  • The resulting link format: https://yoursite.com/?grsf={{referralCode}}&utm_source=growsurf&utm_medium=referral&utm_campaign=referral-program

Step 2: Set Up Custom Events for Referral Actions

Track specific referral actions as Google Analytics events using GA4's custom events.

  • Implement these custom events via GrowSurf's JavaScript SDK callbacks:
    • referral_link_shared β€” when a participant shares their link
    • referral_signup β€” when a referred visitor signs up
    • referral_converted β€” when a referral converts to a customer
  • Use gtag('event', 'referral_signup', { ... }) to send events
  • Include parameters: referral_code, referrer_id, campaign_name

Step 3: Create GA4 Custom Dimensions for Referral Data

Set up custom dimensions in GA4 to store referral-specific data alongside standard analytics.

  • Go to Admin > Custom Definitions > Create Custom Dimensions
  • Create dimensions:
    • "Referral Code" (event-scoped) β€” the participant's referral code
    • "Referred By" (user-scoped) β€” identifies referred users across sessions
    • "Referral Campaign" (event-scoped) β€” the GrowSurf campaign name
  • Send these dimensions with your custom events via gtag()

Step 4: Build a Referral Traffic Segment

Create a Google Analytics segment that isolates all traffic coming from your referral program.

  • Go to Explore > Create Segment
  • Condition: Session source equals "growsurf" OR Session medium equals "referral"
  • This segment lets you analyze referred visitor behavior separately from other traffic
  • Compare this segment against "All Users" to see how referred visitors differ

Step 5: Configure Conversion Tracking for Referrals

Set up GA4 conversions that track when referred visitors complete key actions.

  • Go to Admin > Conversions > New Conversion Event
  • Mark your referral_signup and referral_converted events as conversions
  • Create a conversion funnel in Explore: Referral Link Click β†’ Page View β†’ Sign Up β†’ Conversion
  • Track conversion rate by referral source compared to other channels

Step 6: Build a Referral Analytics Dashboard

Create a GA4 dashboard or Looker Studio report for referral program metrics.

  • Key metrics to display:
    • Referral traffic volume (sessions from growsurf source)
    • Referral conversion rate vs. overall site conversion rate
    • Top referral codes by traffic volume
    • Referral traffic behavior: bounce rate, pages per session, session duration
  • Use Looker Studio for more advanced visualizations connected to GA4 data
  • Schedule automated reports to stakeholders

Code Snippets

// Send GrowSurf referral events to Google Analytics 4
// Add this to your website where GrowSurf's JS SDK is loaded

// Track when a participant shares their referral link
document.addEventListener('grsfShareLinkCopied', function(e) {
  gtag('event', 'referral_link_shared', {
    referral_code: e.detail.referralCode,
    share_method: 'link_copy',
    campaign_name: 'referral-program'
  });
});

// Track referral sign-up (on your sign-up confirmation page)
function trackReferralSignup(participantData) {
  if (participantData.referredBy) {
    gtag('event', 'referral_signup', {
      referral_code: participantData.referralCode,
      referred_by: participantData.referredBy,
      campaign_name: 'referral-program'
    });

    // Set user property for cross-session tracking
    gtag('set', 'user_properties', {
      acquisition_channel: 'referral',
      referred_by: participantData.referredBy
    });
  }
}

// Track referral conversion (on purchase/subscription page)
function trackReferralConversion(participantData, value) {
  gtag('event', 'referral_converted', {
    referral_code: participantData.referralCode,
    referred_by: participantData.referredBy,
    conversion_value: value,
    currency: 'USD',
    campaign_name: 'referral-program'
  });
}

// UTM parameter configuration for GrowSurf referral links:
// Set in GrowSurf Campaign > Settings > Custom Referral Link
// https://yoursite.com/?grsf={{referralCode}}&utm_source=growsurf&utm_medium=referral&utm_campaign=referral-program&utm_content={{referralCode}}

Tips

Use UTM Content for Individual Referrer Tracking

Set utm_content to the participant's referral code. This lets you see which individual referrers drive the most traffic and conversions in Google Analytics, giving you a built-in leaderboard without any additional tooling.

Compare Referral Traffic Quality Against Paid Channels

The most powerful insight from GA referral tracking is comparing referred visitor behavior against paid traffic. Referred visitors typically have higher engagement (lower bounce rate, more pages per session) and higher conversion rates. Use this data to justify referral program investment.

Set Up GA4 Audiences for Remarketing to Referred Visitors

Create a GA4 audience of referred visitors who didn't convert (arrived via growsurf source but didn't trigger a conversion event). Use this audience for remarketing campaigns β€” these visitors already have social proof from the referral, they may just need another touchpoint.

FAQ

Does GrowSurf automatically add UTM parameters to referral links?

GrowSurf allows you to configure custom parameters on referral links, but UTM parameters need to be set up manually in your campaign settings. Configure the referral link template in Campaign Settings to include the UTM parameters alongside GrowSurf's native tracking parameter (grsf).

How do I track referrals across devices in GA4?

GA4's User-ID feature and Google Signals help track users across devices. When a referred user signs up, set their User-ID in GA4. This links their initial referral click (possibly on mobile) to their conversion (possibly on desktop), giving you accurate cross-device referral attribution.

Can I see individual referrer performance in Google Analytics?

Yes, if you use utm_content with the referral code. In GA4, go to Acquisition > Traffic Acquisition and add "Session campaign content" as a secondary dimension. This shows traffic and conversion metrics for each individual referral code.

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