Skip to main content

What Is a Referral Program?

Imagine this: Sarah loves your brand. She refers her friend Mike by sharing a link or code. Mike signs up and places an order. Both Sarah and Mike get rewards, and your business gains a new loyal customer. Referral programs help you:
  • Reward existing customers for bringing in new ones
  • Encourage new customers with an immediate incentive
  • Generate scalable, low-cost growth through trust

How Referral Programs Work in Gameball

RoleTrigger EventReward Type
Referrer (Existing)Friend completes a defined eventPoints or Coupons
Referred FriendJoins and completes the eventBonus Coupon or Gift
The entire setup is configurable:
Event Types
Reward Amounts
Referral Logic
Gameball Automates Linking
Reward Issuance
Tracking

Standard Referral Flow Implementation

What This Is

This is the core referral flow that underpins all referral use cases across web, mobile apps, and offline channels. When implemented correctly, this flow ensures that referral codes are registered, tracked, and rewarded automatically based on your configuration.

Why It Matters

It forms the baseline logic that powers all other referral implementations, including deep links, QR codes.

Example Flow

Customer shares his referral link

Friend signs up using the link

Friend recieves his reward

Friend places his first order

Customer recieves his reward

Platform-Specific Integration

PlatformHow the Referral Code is CollectedWhere to Send ItTools or Notes
🌐 Web (Widget)Auto-detected from URLNo action requiredGameball widget handles logic
💻 Web (Custom UI)Extract from ?ref=CODEreferrerCode in APIUse Create/Update Customer API
📱 Mobile App (SDK)Deep link parameter (Branch or Adjust)referrerCode in registerCustomer MethodFirebase is no longer supported
🏬 POS / Call CenterManual entryreferrerCode in create/update customer APISupports offline, in-person referrals

I. Web Using Gameball Widget

  • The customer’s referral link or code is displayed within the widget.
  • The customer shares this link or code with a friend (the referee).
  • When the friend uses the shared link or code, Gameball automatically detects and registers the referral from the URL.
  • No additional implementation is required on your side.

II. Web with Custom UI

If you’re integrating Gameball referrals using your own web UI instead of the widget, you can still fully enable referral functionality through the Gameball APIs. This process covers:
  1. Displaying each customer’s unique referral link or code
  2. Detecting and capturing referral links when shared by referrers
  3. Submitting the referral code during sign-up
  4. (Optional) Validating referral codes to prevent self-referrals
To show a customer their referral link or code in your UI, fetch it using the Get Customer API:
GET /integrations/customers/{customerId}
You can display either of these two attributes from the API response: Example Response:
{
  "customerId": "mike_123",
  "referralCode": "SARAH123",
  "referralLink": "https://www.myAwesomeWebsite.com?referralCode=SARAH123"
}
Use this data to create custom UI components, such as:
  • A “Share Your Referral Code” banner
  • A “Copy Link” button
  • Or a custom referral dashboard section

2. Detect Referral Visits

When a friend lands on your website using a referral link such as:
https://www.myAwesomeWebsite.com?referralCode=code123
You can detect the referral by checking the URL query parameters for referralCode. Once detected, store this value temporarily until the new customer completes their sign-up.

3. Track Referral Sign-ups

When the referred friend signs up, include the captured referral code in the Create/Update Customer API request. This links the referrer and referee together in Gameball.
POST /integrations/customers
{
  "customerId": "CUST_56789",
  "referrerCode": "code123",
  "customerAttributes": {
    "displayName": "Arya Stark",
    "firstName": "Arya",
    "lastName": "Stark",
    "email": "arya.stark@example.com"
  }
}

Important Notes:

  • referrerCode must be included during initial registration.
    If the referral code is not submitted within 5 minutes of registration, the referral will not be counted. To modify this time threshold or customize the referral linking logic, please get in touch with your Gameball technical point of contact.
  • If the code is invalid, Gameball ignores it silently; the customer is still created, but no referral link is formed.

4. (Optional) Validate Referral Codes Before Signup

To ensure customers don’t use their own referral code or an invalid one, you can validate the code before creating the account. Use the Validate Referrer Code API:
GET /integrations/customers/validateReferrerCode?referrerCode=code123
This API checks whether the referral code:
  • Exists and is valid
  • Belongs to a different customer (to prevent self-referrals)
  • Is eligible for use in the current flow
If the code is valid, proceed with the Create/Update Customer request as shown in step 3. Track Referral Sign-ups

III. Mobile Apps (Branch or Adjust)

Referral links in mobile apps are handled through Gameball’s Mobile SDKs in combination with a deep linking provider such as Branch or Adjust.
Firebase Dynamic Links are no longer supported.
Branch.io and Adjust now handle both link redirection and referral code extraction.
1

Configure Deep Linking

  • Integrate Branch.io or Adjust in your app and connect it from the Gameball dashboard under SettingsAdmin SettingsIntegrationMobile ConfigurationDynamic Link Provider.
  • Each provider automatically attaches the referral code to the deep link (e.g., ?referrerCode=SARAH123).
2

Extract the Referral Code

After the app opens from a referral link, use your deep linking provider’s SDK to extract the code.Example using Branch:
branch.subscribe(({ data }) => {
  const referrerCode = data.referrerCode;
  if (referrerCode) {
    // Proceed with registration through the Gameball SDK
  }
});
3

Register the Customer (Gameball SDK)

Once the code is extracted, call the registerCustomer (or registerPlayer, depending on the SDK version) method from the Gameball SDK and pass the referrerCode as a parameter.Example:
Gameball.registerCustomer({
  customerId: "mike_mobile_789",
  referrerCode: "SARAH123",
  customerAttributes: {
    displayName: "Mike",
    platform: "android",
    email: "mike@mobile.com"
  }
});

Alternative Flow (Manual Entry)

If the customer was not referred via a deep link, you can still allow referrals manually by:
  • Adding a “Referral Code (Optional)” field on your registration/sign-up screen. Image(134) Pn
  • When the user submits the form, collect the entered referral code (if provided).
  • Then:
    • If you’re registering the customer via the frontend SDK, include referrerCode in the registerCustomer call as shown above.
    • If you’re registering the customer via the backend API, include referrerCode in the payload for the Create/Update Customer API:
      {
        "customerId": "mike_mobile_789",
        "referrerCode": "SARAH123",
        "customerAttributes": {
          "displayName": "Mike",
          "email": "mike@mobile.com",
          "platform": "android"
        }
      }
      
This hybrid approach ensures that referral tracking works whether the user comes via a link or enters a code manually.
  • The referral link should be passed within the first registration call.
  • If the referral code is missing or invalid, the customer will still be registered, but the referral relationship will not be created.
  • Referral linking must occur within 5 minutes of registration to be counted.
  • To customize this time window or referral linking logic, please contact your Gameball technical point of contact.

Summary

StepActionTool / Method
1Configure Branch or AdjustGameball Dashboard
2Extract referrerCodebranch.subscribe() / Adjust SDK
3Register customerGameball.registerCustomer()
4Referral linkedGameball backend logic

Monitoring Referral Progress

Allow customers to view who they referred and what the status is. API Reference: Customer Referrals
{
  "referredFriends": [
    {
      "customerId": "cust_123",
      "displayName": "John Doe",
      "email": "john@example.com",
      "mobileNumber": "+1234567890",
      "joinDate": "2025-01-10T12:00:00Z",
      "status": "Active"
    }
  ],
  "count": 123,
  "hasMore": true
}

Suggested UI Components

  • Referral Welcome Popup: Show new users the reward received via referral.
  • Referral Dashboard: Show Existing users who they’ve referred (pending/active)

Developer Checklist

StepMust-Do
Extract referral codeFrom URL param, QR, SDK, or manual
Pass referrerCode on registrationVia registerCustomer API
Trigger referral evente.g. place_order, signup
Display referral progressUse Referral History API
Validate referral codes(Optional) via internal service
Integrate Branch/Adjust (for mobile apps only)Via deep linking SDKs
Don’t allow referral code editing post-signupEnforce immutability in UI/backend