Gameball Developers Guide
v3.0
v3.0
  • Introduction
  • What's New in V3.0
  • Installing Gameball
    • Web
      • Show Gameball Customer Widget
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • iOS
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • React Native
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
      • Migration from v1 to v2
    • Flutter
      • Getting Started
      • Initialize Gameball SDK
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Referrals
      • Go-Live Checklist
    • Generic Mobile App
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
    • Retail & Modern POS
      • Initialize Gameball Customer Profile
      • Track Orders & Cashback Reward
      • Track Refunds
      • Enable Redemption
        • Prepare POS for Redemption
        • Using Virtual ID
          • Using Virtual Card
  • REST API
    • Overview
      • Server-Side SDKs
    • Authentication
    • API Reference
      • Customer
      • Event
      • Transactions
      • Order
      • Coupons
      • Leaderboard 👑
      • Notifications 👑
      • Configurations 👑
      • Batches 👑
        • Batch Operations Data
      • OTP
      • Partner 🤝
        • Client 🤝
        • Redemption Rule 🤝
        • Cashback Rule 🤝
    • Webhooks
      • Notifications Webhook
      • Customer Profile Webhook
    • Errors
    • Object Reference
  • Tutorials
    • Build Custom UI Elements 👑
      • Display Reward Campaign Progress
      • Show VIP Tiers
      • Show Customer Points Balance
      • Build Leaderboards
      • Show Notifications Inbox
      • Adapt UI to Configurations
      • Advanced UI Techniques
        • Increase Sales with Cashback UI Elements
        • Derive Engagement with Rewards Campaigns UI Elements
    • Tracking Customer Events
    • Build your Own Notification System
    • Checkout Integration Example
    • Redemption Integration Options
      • Redeem with coupon system
        • Integrate your coupon system
          • Example using e-commerce platform(WooCommerce)
          • Example using a custom coupon system
        • Build couponing experience
          • Using Gameball widget
          • Build custom experience
            • Showing customers available points
            • Allowing customers to create coupons
            • Apply the discount code to your cart
        • Coupon integration reference
      • Redeem with direct debt
        • Get customers points balance
        • Redeem customer points
  • Third Party Integrations
    • Segment Integration
Powered by GitBook
On this page
  1. Installing Gameball
  2. Generic Mobile App

Track Referrals

Reward your customers for referrals and grow your business.

PreviousIntegrate RedemptionNextPush Notifications

Last updated 1 year ago

Gameball uses Firebase to generate dynamic links to support referrals. Hence Firebase dependency must be used in your mobile app

Before you start, you must configure your Firebase on your Gameball account. Follow the steps in article in our Help Center to configure your Firebase account on Gameball.

Dynamic Links are smart URLs that allow you to send existing and potential users to any location within your app. They survive the app install process, so even new users see the content they're looking for when they open the app for the first time.

Once you've configured Firebase within your Gameball dashboard, Gameball will automatically create a unique referral link for each customer. This referral link includes the customer's unique referral code and can be shared with friends to refer them to your mobile app.

{
   "playerUniqueId":"player456",
   ...
   ....
     "dynamicReferralLink":"https://yourapp.dynamiclink.link",
   ....
   ....
   ...
}

Depending on your desired experience. You can choose to show the referral link within profile page within your app so the users can locate it and share it within their network.

Now that you have allowed your user locate and share their referral links. Below is a step by step guide on how to listen to referral registration and notify Gameball to track and reward.

  1. First, you'll need to set up Firebase within your mobile app.

  2. After setting Firebase within your app and configuring Firebase from Gameball's dashboard, you'll need to listen to deep links query parameters within your app. When a user clicks on a Firebase Dynamic Link that includes the GBReferral parameter, the GBReferral parameter will be included in the deep link query parameters. This parameter contains the referral information that you'll need to send to Gameball to track referrals.

Here's an example of how you can listen to deep links query parameters and locate the GBReferral parameter in your mobile app:

// Listen for incoming Firebase Dynamic Links
Firebase.dynamicLinks().getDynamicLink { (dynamicLink, error) in
  guard let dynamicLink = dynamicLink,
        let deepLink = dynamicLink.url,
        let queryItems = URLComponents(url: deepLink, resolvingAgainstBaseURL: true)?.queryItems else {
    return
  }

  // Locate the GBReferral parameter
  if let gbReferral = queryItems.first(where: { $0.name == "GBReferral" })?.value {
    // Track the referral in your Gameball account
    // ...
  }
}
z
   "playerUniqueId":"referred_player_id",
    "referrerCode": "001122",
  }

This referral link is generated dynamically and can be accessed via Gameball profile widget. It can also be accessed programmatically using the Gameball within its response as below snippet.

Once you have located the GBReferral parameter within a dynamic link. You will need to send its value and send along with the that is being executed for the newly created referred customer.

The below sample body for the creates a new customer with playerUniqueId {referred_player_id} that has been referred by the customer who owns the code of 001122 captured form the dynamic link.

Configure your Firebase account on Gameball for mobile friends referral links
Get Customer API
Create Customer API
Create Customer API