Class – InstallReferrer



public final class InstallReferrer
extends java.lang.Object

Install Referrer.

The Google Install Referrer is based on information obtained from the Google Play Store about the app install. In many cases this indicates the Google Play Store thinks the install was organic but it can also include campaign data for attribution or a deferred deep link.

This information is made available to the host app for convenience purposes for dealing with deferred deep links and is typically available within a couple seconds of Tracker configuration.

Two methods of retrieving the Install Referrer exist. The legacy method using a Broadcast Receiver and the current API that uses the installreferrer library. The Kochava Tracker supports both methods with priority given to the new API with a fallback to the legacy version.

Nested Class Summary

Modifier and Type Class and Description
static interface InstallReferrer.InstallReferrerStatus
Install Referrer status messages.

Field Detail

Modifier and Type Field and Description
long installBeginTime

public final long installBeginTime

Unix Timestamp for when the install began in seconds.

Will be 0 when isLegacy is true.

boolean isLegacy

public final boolean isLegacy

Indicates that this install referrer came from the legacy Broadcast Receiver.

A legacy install referrer will have 0 for both the installBeginTime and referrerClickTime referrer


public final java.lang.String referrer

The install referrer.

long referrerClickTime

public final long referrerClickTime

Unix Timestamp for the ad click in seconds.

Will be 0 when isLegacy is true or if Google Play considers the install organic.

int status

public final int status

Status of this install referrer.


public static final int STATUS_DEVELOPER_ERROR

An error occurred with the implementation. This should never occur.

See Also:
Constant Field Values


public static final int STATUS_FEATURE_NOT_SUPPORTED

Service is not supported on this device.

See Also:
Constant Field Values


public static final int STATUS_MISSING_DEPENDENCY

An exception indicating the required google dependency is missing from the app.

See Also:
Constant Field Values


public static final int STATUS_NOT_GATHERED

An attempt to gather has not yet been made.

See Also:
Constant Field Values

static int STATUS_OK

public static final int STATUS_OK

Install Referrer data is valid.

See Also:
Constant Field Values


public static final int STATUS_SERVICE_DISCONNECTED

The service got disconnected while attempting to gather.

See Also:
Constant Field Values


public static final int STATUS_SERVICE_UNAVAILABLE

Service unavailable at this moment. It may not exist or it may be updating.

See Also:
Constant Field Values


public static final int STATUS_TIMED_OUT

A timeout occurred when attempting to gather.

See Also:
Constant Field Values

Method Detail

Modifier and Type Method and Description
boolean isGathered()

public final boolean isGathered()

Returns if an install referrer gather attempt has been made.

True if a gather attempt has been made, False if not.

boolean isSupported()

public final boolean isSupported()

Returns if the install referrer is supported on this device.

NOTE: The device is considered supported prior to an attempt being made.

True if the device is supported, False if not.

boolean isValid()

public final boolean isValid()

Returns if the referrer contained by this object is valid.

True if install referrer is valid. False if not.


Methods Inherited from class java.lang.Object:

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

See Also

Related Methods Tracker.getInstallReferrer()

Returns the app Install Referrer if present.


Last Modified: Nov 29, 2017 at 9:55 am