Skip to content

Referral program with Referral code & Link

Ram edited this page Feb 11, 2016 · 31 revisions

AppVirality now Supports both referral code and referral link to attribute friend and Referrer. Referral program can be configured with 3 different attribution settings.

  1. Only Referral Link (Default)
  2. Only Referral Code
  3. Link + Referral Code

NOTE: Get in touch with AppVirality Support to configure your campaign attribution settings. "Only Referral Link" is the Default attribution setting.

Only Referral Link(Default) :

Deep link will be used to attribute user in combination with Device finger printing. This method is already proven and 99% accurate. Appvirality makes this 100% accurate by taking advantage of Google Install Referrer on Android and "SFSafariViewController" cookie support on iOS. AppVirality includes click ID in Share URL, which will be returned back by the google install referrer on App first launch.

Example:

  1. Referrer invites his friend by sharing his personal referral link
  2. Friend Clicks on the referral link, which redirects to Play store or Appstore based on Friend's device OS.
  3. Friend installs the App and launches for the first time.
  4. AppVirality uses device finger printing and Google Install Referrer(Android)/SFSafariViewController(iOS) to attribute the friend install to genuine referrer and thereby process the rewards based on the reward rules.

NOTE: Attribution and Reward processing will happen only based on Deep Link.

Only Referral Code:

AppVirality supports referral code, where user installs the App and enters their friends referral code during signup.Even though attribution method set to "Only Referral Code", there are two possibilities.

  1. Friend may directly install the App and enter the referral code

  2. Friend can click on referral link and install the App.

AppVirality uses generic device finger printing technology to attribute the users primarily if friend installs the App by clicking on referral link. But rewards will not be processed. Once user enters his friends referral code, AppVirality verifies previously performed attribution(with device finger printing and deep link) and makes changes to the attribution based on entered referral code and starts processing the rewards. Rewards will be processed based on reward rules and conversion events.

NOTE: Rewards will not be process until user enters his friend's referral code.

Link + Referral Code:

We can have attribution setting set to "Link+Referral Code". Which will enable users to get attributed and rewarded based on both Referral Link and Referral Code. Here again three different cases

  1. User may install the App by clicking on referral link in same network/IP

  2. User may install the App by clicking on referral link in from different network/IP

  3. User may install the App directly and enter his friends referral code.

NOTE: Rewards will be processed in all the cases.

How can I get Referral code to be populated directly on friends first App launch(i.e. during signup)?

Instead of user entering his friends referral code manually, we can auto populate his friends referral code. Use AppVirality init callback to get the referral code after initializing the AppVirality SDK.

Android
                String referralCode = AppviralityAPI.getFriendReferralCode();

NOTE: If you are taking advantage of Google Install referrer, you need not wait for AppVirality init callback method for referral code. You can directly call the above method to populate the referral code during user signup.

iOS

Referrer Code is available in Init callback.i.e. in referrerDetails.

[AppVirality initWithApiKey:@"YOUR-APP-KEY" OnCompletion:^(NSDictionary *referrerDetails,NSError*error) {
            NSLog(@"User has Referrer %@", referrerDetails);
        }];

How to send user entered/auto populated referral code back to AppVirality for attribution and reward processing?

Please use the following callback method to send back the user entered referral code. This will be used if the user is not attributed using Deep link(due to network changes/IP changes) or if user installs the App directly without clicking on referral link.

Android
String referralcode = "AV7YZ";

AppviralityAPI.SubmitReferralCode(referralcode, new AppviralityAPI.SubmitReferralCodeListner() {
						@Override
						public void onResponse(boolean isSuccess) {
							if (isSuccess) {
								Log.i("AppViralitySDK : ", "Referral Code applied Successfully");
							}
							else
							{
								Toast.makeText(Registration.this, "Failed to apply referral code", Toast.LENGTH_SHORT).show();
							}
                            //process Any conversion events(i.e. install/Signup/Transaction..etc) here.
						}

					});

NOTE: If you have opted for "Only Referral Code" attribution setting, please make sure to execute the above callback before sending any conversion events(i.e. Signup,Transaction..etc)

iOS
[AppVirality submitReferralCode:self.txtReferrerCode.text completion:^(BOOL success, NSError *error) {
            if (success) {
                NSLog(@"Referral Code applied Successfully");
            }
            else{
                NSLog(@"Invalid Referral Code");
            }
            
        }];

How to get user referral code to invite their friends?

Android
String myReferralCode =campaignDetails.Shortcode;

AppVirality generates user referral code as soon as user requests for a campaign. The referral code depends on the campaign that user interested to participate. Referral code is nothing but campaign participation ID. This gets generated when AppVirality receives request for campaign from a user for the first time.

We can get the referral code with the help of following code block

 AppviralityAPI.setCampaignHandler(InviteButtonOnCampaignAvailability.this, AppviralityAPI.GH.Word_of_Mouth, new AppviralityAPI.CampaignReadyListner() {
@Override
public void onCampaignReady(CampaignDetails campaignDetails) {
if (campaignDetails != null) {
Log.i("AVLOG", "Campaign Details Ready now");
//Referral code to invite friends
String myReferralCode =campaignDetails.Shortcode;
//Set Campaign Details
CampaignHandler.setCampaignDetails(campaignDetails);
// make the Invite button visible as the campaign details are available
btnShowGrowthHack.setVisibility(View.VISIBLE);
}
}
});
iOS
[AppVirality showGrowthHack:growthHack completion:^(NSDictionary *campaignDetails,NSError*error) {
NSString * myReferralCode = [campaignDetails valueForKey:@"shortcode"];
}];
    

Examples on how to get referral code

Example 1

Example 2

Help on other topics:

Please have a look at our Wiki page

  1. Getting Started With AppVirality Android SDK Integration
  2. AppVirality API for referral Growth Hack
  3. How to Add Test Devices & Test Referral Program
  4. Using Custom Domain
  5. Init Callback | hasReferrer | getUserKey
  6. Using Referral Code & Referral Link
  7. [Optional] Exclude Premium Users
  8. [Optional] Dynamic Share Message
  9. [Optional] Remind Later Settings
  10. [Optional] To Whom and When to Show Growth Hack
  11. [Optional] Reward Notifications or Web-hook Configuration
  12. [Optional] Android Push Notification Configuration
  13. [Optional] Personalized Welcome Screen
  14. Referral Program on Apps having Login and Logout