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:

iOSAndroid and Other SDKs
nil
"" (empty string)

Unattributed Install Response

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

{"success":1,"action":"get_attribution","data":{"kochava_device_id":"KI7775605795TE7DBB78F4B734074B550B83603FFA37B","retry":-1,"attribution":false}}

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 —

{
     "is_first_install": false
}

 

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 Exists —

// a deferred deeplink exists
{
     "deferred_deeplink": {
	     "destination": "app://home/playlist/12345"
     }
}

 

Example: No Deferred Deeplink is Present —

// no deferred deeplink present
{
     "deferred_deeplink": {
	     "destination": ""
     }
}

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.

 

{ "attribution": {
	"agency_network_id": "0",
	"attribution_action": "install",
	"attribution_module": "kochava",
	"attribution_prompt": "click",
	"campaign": "Primary Campaign",
	"campaign_id": "YOUR-CAMPAIGN-ID",
	"click": {
    	"date": "2017-11-22 21:31:40",
    	"deeplink": "",
    	"id": 629,
    	"meta": {
        	"adid": "THE-DEVICE-ADID",
        	"control_server": "172.18.95.189",
        	"original_request": "campaign_id=YOUR-CAMPAIGN-ID&network_id=0000&device_id=THE-DEVICE-ID&device_id_type=adid&site_id=none-providedko_click_id=ko_4ac75a15ecbc50faf&in_time_ms=1511386300332&in_time=1511386300&inboarder=f4&header_ip=000.111.222.333",
        	"origination_ip": "000.111.222.333"
    	},
    	"timestamp": 1511386300
	},
	"control_server": "172.18.95.189",
	"country": "US",
	"creative": "",
	"creative_id": "",
	"date": "2017-11-22 21:31:55",
	"date_modified": "",
	"date_processed": "2017-11-22 21:31:40",
	"date_utc": "2017-11-22 21:31:40",
	"day_of_week": "3",
	"device_id": "",
	"device_id_type": "adid",
	"device_ver": "Pixel XL-Android-8.1.0",
	"duplicate": "628",
	"geolocation": "",
	"header_ip": "000.111.222.333",
	"id": "629",
	"id_type": "adid",
	"id_value": "THE-DEVICE-ADID",
	"identifiers": "{\"adid\":\"THE-DEVICE-ADID\"}",
	"in_time": "1511386300",
	"in_time_ms": "1511386300332",
	"inboarder": "f4",
	"install": {
    	"date": "2017-11-22 21:31:55",
    	"id": 1064,
    	"meta": {
        	"advertiser_tracking_enabled": "0",
        	"alt_device_id": "ALTERNATIVE-DEVICE-IDENTIFIERS",
        	"app_version": "My App Version 1",
        	"application_tracking_enabled": "0",
        	"control_server": "172.18.95.123",
        	"device": "Pixel XL-Android-8.1.0",
        	"device_id": "THE-DEVICE-ADID",
        	"device_id_type": "adid",
        	"device_model": "Pixel XL-google",
        	"device_ua": "Dalvik/2.1.0 (Linux; U; Android 8.1.0; Pixel XL Build/OPP5.170921.005)",
        	"device_ver": "Pixel XL-Android-8.1.0",
        	"in_time": "1511386315",
        	"inboarder": "b5",
        	"matched_by": "adid",
        	"matched_on": "THE-DEVICE-ADID",
        	"origination_ip": "000.111.222.333",
        	"price_type": "cpc",
        	"receipt_status": "no_receipt",
        	"reconciliation_request_click": "201711222131566LQIEX6SGK856364925",
        	"sdk_version": "AndroidTracker 3.3.0",
        	"utm_source": ""
    	},
    	"timestamp": 1511386315
	},
	"ip_address": "000.111.222.333",
	"ko_click_id": "ko_4ac75a15ecbc50faf",
	"legacy_tracker_id": "13033563741",
	"lookback": 2592000,
	"lookback_used": "default",
	"matched_impression": "",
	"matched_install": "",
	"month": "11",
	"network": "Kochava Soltest - General",
	"network_id": "2820",
	"network_key": "kochavasoltest",
	"original_request": "campaign_id=YOUR-CAMPAIGN-ID&network_id=2820&device_id=THE-DEVICE-ADID&device_id_type=adid&site_id=none-provided&ko_click_id=ko_4ac75a15ecbc50faf&in_time_ms=1511386300332&in_time=1511386300&inboarder=f4&header_ip=000.111.222.333",
	"price": "",
	"site": "none-provided",
	"site_id": "none-provided",
	"status": "publish",
	"tier": "Default Segment",
	"timestamp": 1511386315,
	"tracker": "adid",
	"tracker_id": "YOUR-TRACKER-ID",
	"unix_date": "1511386300",
	"user_agent": "",
	"waterfall_level": "device"
}} 

 

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.

 
 

Last Modified: Oct 11, 2023 at 1:13 pm