Track Referrals

Reward your players for referrals and grow your business

Introduction

One of the most effective ways to get new users is through user referrals. You can use Gameball referrals capabilities to encourage your users to invite their friends by offering rewards for successful referrals to both the referrer and the recipient.
Gameball referrals uses Firebase Dynamic Links in the background to generate players referral links and track referrals. Dynamic Links are smart URLs (deep links) that survive the app install process, so new referred users via referral links will be easily tracked when they open the app for the first time.
Gameball and its SDK provides hassle free integration to track referrals where you will only need to
  1. 1.
    Provide your firebase info through Gameball dashboard to generate referral links to your players
  2. 2.
    Invoke referral method with every new account creation through your app.
Your players will be able to get and share their referral link from Gameball Player Widget
Tracking referral requires Firebase and Firebase Dynamic Links SDKs installed into your app.

Integration Steps

To integrate and track referrals you need to perform two main steps
  1. 1.
    Configure your Firebase dynamic links settings from your firebase console
  2. 2.
    Configure Firebase on your App and Gameball account dashboard
  3. 3.
    Invoke SDK Referral method within your App user registration flow

1. Firebase configuration

  • Add the firebase dynamic links dependency in your project
implementation 'com.google.firebase:firebase-dynamic-links:17.0.0'
  • In your manifest file add an intent filter in the activity that handles the deep links
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="example.com"
android:scheme="https"/>
</intent-filter>
For more information check Firebase Docs

2. Invoke SDK Referral method

addReferral SDK methodThis should be called after your user registration, hence a new player is created. It basically detects if the user has registered using a referral code or not. Generally, it should be called in the onSucess for registerPlayer method.

addReferral(Activity activity, Intent intent)

  • In your manifest file add an intent filter in the activity that you are going to call addReferral
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="example.com"
android:scheme="https"/>
</intent-filter>