User Invite Tracking

  • Advertisers
  • Developers

Introduction

Allowing your existing users to invite their friends and contacts as new users to your app can be a key growth factor for your app. AppsFlyer allows you to track and attribute new installs originating from user invites within your app.

 Note

User Invite Tracking is available on AppsFlyer's SDK versions 4.8.0 and above and Unity SDK version 4.17.0.

Why is Tracking User Invites So Useful?

Obtain information about the best-referring users

Users that refer their friends to your app are high value engaged users, which you may want to preserve, retarget or incentivize.

Use the referring user information to personalize the first time experience for the new user
Instead of a general welcome message, you could have a personalized message, which engages the new user much more. For example: "Welcome, John! Join your friend Marsha in an epic battle after you finish the tutorial".
Know the cost and ROI of user invites for better results
Are user invites free of charge? Not really. They use up your app's advertising "real estate", which could alternately get you real ads revenue.

Do user invites get you positive ROI, compared with the alternative?
In some cases they do, and in others, they don't.


You can use AppsFlyer's cost parameters to assign cost to user invite installs, based on the alternatives.

 Example

A banner gains you $5 RPM with ads views (here's a great way to measure it). On average, with a 2% conversion rate of views to invites, and with a 10% conversion rate of invites to installs, you get 2 new users from every 1K views. Therefore, using the same banner space to promote invites costs 5$/2=$2.5 per install. Add af_cost_value=2.5 value to reflect this cost on the dashboard.


Combined with your revenue reporting in-app events you are able to see which user invites campaigns give you the best or worst results, and which invite channels are best for your purposes.

How Does Tracking User Invite Work?

Installs attributed to an invite link appear on the dashboard under the media source af_app_invites.

The channels used to send the invites through (mail, SMS, Facebook etc.) appear under the Channel grouping under the media source af_app_invites.

Selecting af_app_invites media source, and grouping by Channel, displays clicks and installs from user invites that went through Gmail and Facebook

The Developer's Guide

Importing libs

On Android make sure to import the following libs:

import com.appsflyer.share.ShareInviteHelper;
import com.appsflyer.share.LinkGenerator;

Setting OneLink

Invite Tracking uses OneLink to redirect the invited user to the relevant app store. Make sure to configure OneLink correctly for your app, and take the relevant OneLink ID.

Before calling startTracking in your app, set the OneLink which is invoked according to the OneLink ID (1bBC in this example):

one_link_id.png

 Note

Make sure the correct OneLink ID is used. Otherwise, the created tracking link is broken.

Android iOS Unity
AppsFlyerLib.getInstance().setAppInviteOneLink("1bBC");

 Important

To generate a shortened OneLink with the User Invite feature you must set a sub-domain for your OneLink in the OneLink Configurations page, under Additional Configurations. If you do not set a unique sub-domain for your OneLink, a "long" OneLink is generated with all added parameters visible on the link.

User_invite1.png

Generating the Link

The LinkGenerator class builds the invite URL according to various setter methods which allow passing on additional information on the click. This information is available through getConversionData when the new user accepts the invite and installs the app. In addition, campaign and channel parameters are visible in the AppsFlyer Dashboard.

Android iOS Objective-C iOS Swift Unity
LinkGenerator linkGenerator = ShareInviteHelper.generateInviteUrl(MainActivity.this);
linkGenerator.setChannel("Gmail");
linkGenerator.addParameter("af_cost_value","2.5");
linkGenerator.addParameter("af_cost_currency","USD");
CreateOneLinkHttpTask.ResponseListener listener = new CreateOneLinkHttpTask.ResponseListener() {
	@Override
	public void onResponse(String s) {
		Log.d("Invite Link", s);
    // write logic to let user share the invite link
	}

	@Override
	public void onResponseError(String s) {
		// handle response error
	}
};
linkGenerator.generateLink(MainActivity.this, listener);

 Note

onResponse and onResponseError are callback methods for generating OneLink URLs. They are part of the CreateOneLinkHttpTask.ResponseListener interface and need to be implemented. They are used to generate invite links that you can put in various views in the application.

All Link Generator Setters

Android iOS
API Name Description Usage

setChannel(String channel)

The channel through which the invite was sent (e.g. Facebook/Gmail/etc.)

Recommended

setCampaign(String campaign)

A campaign name

Optional

setReferrerName(String referrerName)

The name of the referring user

Optional

setReferrerImageURL(String referrerImageURL)

The URL to referrer user avatar

Optional

setReferrerCustomerId(String referrerCustomerID)

Set the customer_user_id of referrer user

Optional

addParameter(String key, String value)

A single key value custom parameter

Optional

addParameters(Map<String, String> parameters)

Multiple key value custom parameters

Optional


Tracking the Sender's Invites

It is recommended to generate an in-app event after the invite is sent to track the invites from the senders' perspective. This enables you to find the users that tend most to invite friends, and the media sources that get you these users.

You can send a regular in-app event or use trackInviteSent method instead. trackInviteSent is a ready-made in-app event encapsulated in an API for easier use.

Android iOS
ShareInviteHelper.trackInviteSent(context, channel, additionalParametersForTheEvent_optional);

Retrieving Attribution Data After Invited User Install

All the parameters passed in the link generator are available by calling getConversionData. This allows you to retrieve the relevant parameters (such as referrer name and avatar url) and personalize the first time experience for the new user. This is an example of the attribution data returned by getConversionData:

{
	"attribute": "is_first_launch" = "true"
	"attribute": "click_time" = "2019-04-04 08:33:05.668"
	"attribute": "af_referrer_customer_id" = "CUSTOMER_USER_ID"
	"attribute": "shortlink" = "12a3b456"
	"attribute": "af_referrer_uid" = "1234567890123-4567890123456789012"
	"attribute": "af_siteid" = "com.company.app"
	"attribute": "install_time" = "2019-04-04 08:33:45.286"
	"attribute": "cost_cents_USD" = "0"
	"attribute": "campaign" = "None"
	"attribute": "af_click_lookback" = "7d"
	"attribute": "orig_cost" = "0.0"
	"attribute": "af_status" = "Non-organic"
	"attribute": "iscache" = "true"
	"attribute": "media_source" = "af_app_invites"
}

More information about using conversion data: iOS and Android.

Custom Dashboard Views

Below are the available views of the Custom Dashboard that show user invite information:

Was this article helpful?
1 out of 4 found this helpful

Page Contents: