Support Home > SDK Integration > SDK – KochavaTracker Android

SDK – KochavaTracker Android

SDK

KochavaTracker Android


A lightweight and easy to integrate SDK written in Java, providing first-class integration with Kochava’s installation attribution and analytics platform.

 

Platforms:

  • Android
  • Android TV
  • Android Wear
  • Android Auto
  • Android Instant App
  • Google Daydream VR
  • Samsung Gear VR
  • Amazon Fire

 

Requirements:

  • Android API 14
  • Internet Permission
  • Google Play Services Base Library (if publishing on the Google Play Store)
  • Google Install Referrer Library (if publishing on the Google Play Store)

Integration

  1. Add the SDK into your project.

     

    You have the option of downloading the SDK either using Maven, or through the direct download of the AAR file.

     

    Using Maven:

    Add the Kochava Maven repository to your root-level build.gradle file.

     

    Add the Kochava SDK to your module level build.gradle file. Replace “x.y.z” with the version obtained from the Download Badge above.

     

    Direct Download:

    Download the AAR file from the Download Badge above and either add it directly or extract the JAR file and other resources from it and add them individually.

     

  2. Add Dependencies.
    Dependencies are added alongside the Kochava SDK in your module level build.gradle file.

     

  3. Add Permissions.
    Permissions are added to the top level of the AndroidManifest.xml file. Required and Recommended permissions are automatically added when using the AAR. If a recommended permission is unwanted it can be removed using the tools:node=”remove” feature.

     

    NOTE: Ensure you are compliant with the terms and requirements of the publishing app store regarding sensitive permissions such as GET_ACCOUNTS.

     

     

  4. Broadcast Receiver.

     

    DEPRECATED: As of 3.3.0, because Google has introduced a new way of retrieving the Install Referrer. Add the install referrer library listed in dependencies to ensure collection with the new API. You should also continue using the broadcast receiver until Google completes the transition.

     

    The Kochava Tracker features an AAR included broadcast receiver that listens for the INSTALL_REFERRER broadcast action. If the Kochava Tracker broadcast receiver is the only receiver for that action in your app no further action is required. Otherwise refer to the ReferralReceiver reference for advanced configuration instructions.

     

  5. Configure a Tracker.
    To configure the Tracker, first create a Tracker.Configuration object, and then perform the configuration using the configuration method Tracker.configure(com.kochava.base.Tracker.Configuration). It is recommended that you call this in your Application.onCreate method.

     

    NOTE: If you are doing an advanced configuration such as in a multiple process app then read the advanced usage section in Tracker.Configuration.

     


Using the SDK

Sending Events

More than basic analytics, the events you send to Kochava are associated with your install attribution data, so that you can understand how the users who came to you through a particular ad went on to use the various features within your app. For more information, refer to Tracker.Event.

 

Setting Identity Link:

You can link additional identifying information with an install, where it can be integrated with your analytics. For more information see Tracker.setIdentityLink(com.kochava.base.Tracker.IdentityLink).

 

Getting Attribution:

You can retrieve Kochava’s attribution information within your app. For more information see Tracker.getAttribution().

 

Getting the Device ID:

You can get the unique device identifier used by the tracker. For more information see Tracker.getDeviceId().

 

Adjusting the Log Level:

You can specify the types of entries which the tracker prints to the log. For more information see Tracker.LogLevel.


Reference

For detailed information about the available classes and their associated resources, see documents below.

Tracker

Tracker entry point.

Tracker.Configuration

Tracker Configuration Builder.

Tracker.Event

Event Builder.

Tracker.IdentityLink

Identity Link Builder.

Tracker.EventType

Tracker Event types.

Tracker.LogLevel

Tracker Logging Levels.

AttributionListener

DEPRECATED: Tracker Attribution listener.

AttributionUpdateListener

Tracker Attribution Update listener.

ReferralReceiver

Install Referrer Receiver.

InstallReferrer

Install Referrer

InstallReferrer.InstallReferrerStatus

Install Referrer status messages.

 
 

Last Modified: Feb 12, 2018 at 10:13 am