User Invite Tracking

  • Advertisers
  • Developers


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.


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.


A banner gains you $5 RPM with ads views (here's a great way to measure it). On average, with 2% conversion rate of views to invites, and with 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 get you the best or worst results, and which invite channels are best for your purposes.

How Does Tracking User Invites Work?

Installs attributed to an invite link generated by this API 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

Set out below are the instructions for the developer for using Invite Tracking.

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 utilizes the capabilities of OneLink to redirect the 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 (12345678 in this example):


It is critical to check that the correct OneLink ID is used, otherwise the created tracking link is broken.

Android iOS Unity


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.


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 within the AppsFlyer Dashboard.

Android iOS Objective-C iOS Swift Unity
LinkGenerator linkGenerator = ShareInviteHelper.generateInviteUrl(MainActivity.this);
//Register to listener (shortLink will be generated by async way)
CreateOneLinkHttpTask.ResponseListener listener = this;
linkGenerator.generateLink(MainActivity.this, listener);

// shortLink response:
public void onResponse(final String oneLinkUrl) { /* share To App … */}
public void onResponseError(final String oneLinkUrl) { /* share To App … */}


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.)


setCampaign(String campaign)

A campaign name


setReferrerName(String referrerName)

The name of the referring user


setReferrerImageURL(String referrerImageURL)

The URL to referrer user avatar


setReferrerCustomerId(String referrerCustomerID)

Set the customer_user_id of referrer user


addParameter(String key, String value)

A single key value custom parameter


addParameters(Map<String, String> parameters)

Multiple key value custom parameters


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 usage.

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:

  "af_referrer_appsflyer_id": "1486491540044-6065693449807548958",
  "af_channel": "Gmail",
  "test": "value",
  "media_source": "af_app_invites",
  "adset": "null",
  "campaign": "None",
  "af_status": "Non-organic",
  "af_referrer_image_url": "",
  "af_referrer_name": "Ben Jones",

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 3 found this helpful