Support Home > Reference Information > Attribution Response Examples

Attribution Response Examples


The following examples illustrate typical attribution responses provided by the SDK via the attribution callback or property. While some values may differ slightly depending on the platform, the examples below will help you to determine how best to utilize the attribution response within your app.


Prior to Retrieval

Attribution retrieval requires the SDK to communicate with Kochava servers during the first launch of the app. This request typically happens 5-10 seconds after launch and will trigger the attribution callback upon completion. If your code queries the attribution property before attribution has been retrieved the returned value will be empty. In this case your code should wait for the attribution callback or try again later. Empty values are as follows:

iOS Android and Other SDKs

Unattributed Install Response

If the install was not attributed (organic), the following is returned:


Convenience Values

While the attribution results contain many data points, certain key and value pairs have been added for your convenience and are described below. Keep in mind these values are only present for attributed installs; they are not present for organic installs.

 

is_first_install:

This boolean indicates whether the current installation of the app is the first install as opposed to a reinstall. This value does not indicate a difference in attribution results between installs, as attribution results are always from the first install. This value is important to know at the moment the app is parsing the attribution results, because the app likely only wants to act on attribution results on the first install, and not a reinstall. If the value is true, the current installation of the app is the first install. If the value is false, the current installation of the app is a reinstall (and you may be more inclined to ignore the attribution results).

NOTE: The is_first_install value is present only if attribution results were requested by the SDK.

 

Example: identifying a reinstall —

 

The is_first_install flag is important for deferred deeplinking. If a user installs an app with a deferred deeplink, the attribution results will contain said deferred deeplink and the app will route the user accordingly. Then, if the user uninstalls and reinstalls the app two weeks later, the same deferred deeplink from the original install would be provided in the attribution results during the reinstall. An app needs to know this so it can choose not to apply that deferred deeplink, if that is the desire, and this flag allows that determination to be made. Without using this flag, the app would end up routing the user on a reinstall to a likely irrelevant deferred deeplink location.

 

Example Flow —

  1. User installs app for the first time with a deferred deeplink.
  2. App gets attribution results from the SDK and finds a deferred deeplink.
  3. App checks the is_first_install flag, which is true.
  4. App routes the user using the deferred deeplink.
  5. Two weeks later, user uninstalls and reinstalls the app.
  6. App gets attribution results from the SDK and finds a deferred deeplink from the original install.
  7. App checks the is_first_install flag, which is now false, and decides to ignore the deferred deeplink because it knows the deferred deeplink was from a previous install.

 

deferred_deeplink:

This object contains a deferred deeplink destination for your convenience, which is derived from both the deeplink and original_request values elsewhere in the attribution results. It is a convenience only, and may save you the trouble of parsing the deeplink and original_request values manually.

NOTE: If no deferred deeplink exists, the destination value is still present but is an empty string.

 

Example: A Deferred Deeplink Exist —

 

Example: No Deferred Deeplink is Present —


Attributed Install Example Response

If the install was attributed, the “attribution” value contains a larger object which describes the details of the attribution. The example below represents a typical attributed response.

NOTE: Results may vary based on what is available at the time of the attribution object request.

 

 

NOTE: The attribution response is provided as a JSON dictionary; however, iOS provides this attribution response as a dictionary while all other platforms provide this value as a serialized dictionary in string form.