Android – API Reference


This page lists all public classes, enumerations and other resources available when using the Kochava Android SDK and is intended to be used only as a developer quick reference guide. For examples and discussion surrounding SDK usage please refer to our Using the SDK support documentation.


Tracker

Class
Represents an instance of the Kochava Tracker.

Method
Starts the tracker with the provided configuration object.

Usage:
Starting the Tracker
Custom Tracker Configuration

Method
Stops the Tracker and will optionally clear all persisted data if the provided boolean is true. The Tracker should not be started and stopped more then once per app launch.

Usage:
Starting the Tracker

Method
Returns if the Tracker is currently configured and started.

Method
Returns the Tracker version.

Example:AndroidTracker 3.4.2

Usage:
Getting the SDK Version

Method
Returns the unique device id string set by Kochava or an empty string if the Tracker is not started.

Usage:
Getting the Kochava Device ID

Method
Returns the attribution results as stringified json or an empty string if not available.

Usage:
Retrieving Attribution

Method
Returns if the app is currently in the foreground.

Method
Returns the Google Play Install Referrer.

Method
Sets whether advertising identifier tracking should be limited.

Usage:
Enabling App Limit Ad Tracking

Method
Adds a new Firebase Cloud Messaging instance ID token.

Usage:
Push Engagement

Method
Removes an existing Firebase Cloud Messaging instance ID token.

Usage:
Push Engagement

Method
Returns the sleep state of the tracker.

Usage:
Sleeping the Tracker

Method
Sets the sleep state of the tracker.

Usage:
Sleeping the Tracker

Method
Sends an event using an Event object.

Usage:
Tracking Events
Purchases and Subscriptions

Method
Sends an event using an event name and event data. The event data value can also be either an empty string or serialized json.

Usage:
Tracking Events

Method
Sets a deeplink listener capable of handling launch and deferred deeplinks using the default 4 second timeout.

Usage:
Deeplinking

Method
Sets a deeplink listener capable of handling launch and deferred deeplinks using the provided timeout between 250 and 10,000 milliseconds.

Usage:
Deeplinking

Method
For use only when Intelligent Consent Management is enabled. Returns the top level consent description.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns the list of consent partners as configured on the Kochava dashboard. If the first connection has not been made with Kochava servers the array will be empty.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns the list of consent partners as configured on the Kochava dashboard as serialized json. If the first connection has not been made with Kochava servers the array will be empty.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not consent is required for this user (based on your regional consent settings in the Kochava dashboard).

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when both Intelligent Consent Management and Manual Managed Consent Requirements are enabled. Sets whether or not consent is required for this user.

Usage:
Intelligent Consent Management – Other Functionality
Manual Managed Consent

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not this user has currently granted consent.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Called when a user has explicitly granted (true) or declined (false) consent.

Usage:
Intelligent Consent Management – Reporting Consent Results

Method
For use only when Intelligent Consent Management is enabled. This helper method returns true if consent is either not required or has been granted for this user. This is typically checked before proceeding with consent-required logic. Recommended over individual checks as these two values should often be checked together.

Usage:
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Returns when consent was either granted or declined.

Usage:
Intelligent Consent Management – Other Functionality

Method
For use only when Intelligent Consent Management is enabled. Returns true if this user needs to be freshly prompted for consent. Immediately after displaying the prompt, an additional call to clearConsentShouldPrompt() should always be made.

Usage:
Intelligent Consent Management – Prompting For Consent
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Called when a consent dialog prompt has been displayed to a user.

Usage:
Intelligent Consent Management – Prompting For Consent
Intelligent Consent Management – Checking Consent Status

Method
For use only when Intelligent Consent Management is enabled. Returns whether or not the SDK knows if consent is required or not for this user based on a server handshake having been completed.

Usage:
Intelligent Consent Management – Other Functionality

Method
(Reserved) Sets the version extension.


Tracker.Configuration

Class
Represents a tracker configuration.

Usage:
Starting the Tracker
Custom Tracker Configuration

Constructor
Creates a tracker configuration object to be passed to the Tracker.configure method.

  • nonull Configuration addCustom(nonnull String, nonnull String
  • nonull Configuration addCustom(nonnull org.json.JSONObject)
  • nonull Configuration setAppGuid(nonnull String)
  • nonull Configuration setAppLimitAdTracking(boolean)
  • nonull Configuration setAttributionUpdateListener(nonnull AttributionUpdateListener)
  • nonull Configuration setConsentStatusChangeListener(nonnull ConsentStatusChangeListener)
  • nonull Configuration setIdentityLink(nonnull IdentityLink)
  • nonull Configuration setIntelligentConsentManagement(boolean)
  • nonull Configuration setManualManagedConsentRequirements(boolean)
  • nonull Configuration setLogLevel(Tracker.LogLevel)
  • nonull Configuration setPartnerName(nonnull String)


Tracker.Event

Constructor
Creates a standard event object to be populated and passed to the Tracker.sendEvent method.

Constructor
Creates an event object with a custom name to be populated and passed to the Tracker.sendEvent method.

  • nonnull Event setAction(nonnull String)
  • nonnull Event setAdCampaignId(nonnull String)
  • nonnull Event setAdCampaignName(nonnull String)
  • nonnull Event setAdDeviceType(nonnull String)
  • nonnull Event setAdGroupId(nonnull String)
  • nonnull Event setAdGroupName(nonnull String)
  • nonnull Event setAdMediationName(nonnull String)
  • nonnull Event setAdNetworkName(nonnull String)
  • nonnull Event setAdPlacement(nonnull String)
  • nonnull Event setAdSize(nonnull String)
  • nonnull Event setAdType(nonnull String)
  • nonnull Event setBackground(boolean)
  • nonnull Event setCheckoutAsGuest(nonnull String)
  • nonnull Event setCompleted(boolean)
  • nonnull Event setContentId(nonnull String)
  • nonnull Event getContentType(nonnull String)
  • nonnull Event setCurrency(nonnull String)
  • nonnull Event setDate(nonnull String)
  • nonnull Event setDate(nonnull java.util.Date)
  • nonnull Event setDescription(nonnull String)
  • nonnull Event setDestination(nonnull String)
  • nonnull Event setDuration(double)
  • nonnull Event setEndDate(nonnull String)
  • nonnull Event setEndDate(nonnull java.util.Date)
  • nonnull Event setGooglePlayReceipt(nonnull String, nonnull String)
  • nonnull Event setItemAddedFrom(nonnull String)
  • nonnull Event setLevel(nonnull String)
  • nonnull Event setMaxRatingValue(double)
  • nonnull Event setName(nonnull String)
  • nonnull Event setOrderId(nonnull String)
  • nonnull Event setOrigin(nonnull String)
  • nonnull Event setPayload(nonnull android.os.Bundle)
  • nonnull Event setPayload(nonnull org.json.JSONObject)
  • nonnull Event setPrice(double)
  • nonnull Event setQuantity(double)
  • nonnull Event setRatingValue(double)
  • nonnull Event setReceiptId(nonnull String)
  • nonnull Event setReferralFrom(nonnull String)
  • nonnull Event etRegistrationMethod(nonnull String)
  • nonnull Event setResults(nonnull String)
  • nonnull Event setScore(nonnull String)
  • nonnull Event setSearchTerm(nonnull String)
  • nonnull Event setSpatialX(double)
  • nonnull Event setSpatialY(double)
  • nonnull Event setSpatialZ(double)
  • nonnull Event setStartDate(nonnull String)
  • nonnull Event setStartDate(nonnull java.util.Date)
  • nonnull Event setSuccess(nonnull String)
  • nonnull Event setUserId(nonnull String)
  • nonnull Event setUserName(nonnull String)
  • nonnull Event setValidated(nonnull String)

  • nonnull Event addCustom(nonnull JSONObject)
  • nonnull Event addCustom(nonnull String, boolean)
  • nonnull Event addCustom(nonnull String, nonnull java.util.Date)
  • nonnull Event addCustom(nonnull String, double)
  • nonnull Event addCustom(nonnull String, long)
  • nonnull Event addCustom(nonnull String, nonnull String)


Tracker.IdentityLink

Class
Represents an instance of the Identity Link builder.

Usage:
Identity Linking

Method
Sets an identity link using a string key and value pair. Can be called multiple times for multiple values.

Sets an identity link using a map of string key and value pairs. Can be called multiple times for multiple maps.


Tracker.EventType

Annotation Type
Passed to the Event constructor when creating a standard event.

Usage:
Tracking Events
Purchases and Subscriptions

  • Tracker.EVENT_TYPE_ACHIEVEMENT
  • Tracker.EVENT_TYPE_ADD_TO_CART
  • Tracker.EVENT_TYPE_ADD_TO_WISH_LIST
  • Tracker.EVENT_TYPE_CHECKOUT_START
  • Tracker.EVENT_TYPE_LEVEL_COMPLETE
  • Tracker.EVENT_TYPE_PURCHASE
  • Tracker.EVENT_TYPE_RATING
  • Tracker.EVENT_TYPE_REGISTRATION_COMPLETE
  • Tracker.EVENT_TYPE_SEARCH
  • Tracker.EVENT_TYPE_TUTORIAL_COMPLETE
  • Tracker.EVENT_TYPE_VIEW
  • Tracker.EVENT_TYPE_AD_VIEW
  • Tracker.EVENT_TYPE_PUSH_RECEIVED
  • Tracker.EVENT_TYPE_PUSH_OPENED
  • Tracker.EVENT_TYPE_CONSENT_GRANTED
  • Tracker.EVENT_TYPE_DEEP_LINK
  • Tracker.EVENT_TYPE_AD_CLICK
  • Tracker.EVENT_TYPE_START_TRIAL
  • Tracker.EVENT_TYPE_SUBSCRIBE


Tracker.LogLevel

Annotation Type
Used when providing a desired log level during tracker configuration.

Usage:
Enabling Logging

  • Tracker.LOG_LEVEL_NONE
  • Tracker.LOG_LEVEL_ERROR
  • Tracker.LOG_LEVEL_WARN
  • Tracker.LOG_LEVEL_INFO
  • Tracker.LOG_LEVEL_DEBUG
  • Tracker.LOG_LEVEL_TRACE


AttributionUpdateListener

Interface
This interface is used for your attribution results event listener.

Usage:
Retrieving Attribution

Method
Callback on the main thread containing the attribution result as serialized json.


ReferralReceiver

Class
Represents a BroadcastReceiver that retrieves the legacy Google Play Install Referrer.

Usage:
Install Referral Broadcast Receiver

Method
Method that retrieves the included legacy install referrer from the intent.


InstallReferrer

Class
Represents an instance of the gathered Install Referrer data.

  • boolean isGathered()
  • boolean isSupported()
  • boolean isValid()

  • long installBeginTime
  • boolean isLegacy
  • nonull String referrer
  • long referrerClickTime
  • Int status


InstallReferrer.InstallReferrerStatus

Annotation Type
Used when checking the gathering status of the Install Referrer.

  • InstallReferrer.STATUS_SERVICE_DISCONNECTED
  • InstallReferrer.STATUS_OK
  • InstallReferrer.STATUS_SERVICE_UNAVAILABLE
  • InstallReferrer.STATUS_FEATURE_NOT_SUPPORTED
  • InstallReferrer.STATUS_DEVELOPER_ERROR
  • InstallReferrer.STATUS_TIMED_OUT
  • InstallReferrer.STATUS_MISSING_DEPENDENCY
  • InstallReferrer.STATUS_NOT_GATHERED


ConsentStatusChangeListener

Interface
This interface is used for your consent status updated event listener.

Usage:
Intelligent Consent Management

Method
Callback on the main thread indicating that a consent related item has changed.


Tracker.ConsentPartner

Class
An individual partner within the Kochava Intelligent Consent Management system.

Usage:
Intelligent Consent Management

  • nonnull String description
  • boolean granted
  • nonnull String name
  • long responseTime
  • nonnull String KEY_DESCRIPTION
  • nonnull String KEY_GRANTED
  • nonnull String KEY_NAME
  • nonnull String KEY_PARTNERS
  • nonnull String KEY_RESPONSE_TIME


DeepLinkListener

Interface
This interface is used for your deferred or launch deeplink event listener.

Usage:
Deeplinking

 
 

Last Modified: Nov 11, 2019 at 3:20 pm