Support Home > SDK Integration > Roku – SDK Integration

Roku – SDK Integration

The Kochava Roku SDK is a lightweight plugin which can be easily integrated into your Roku project. The entire integration process takes less than five minutes and simply requires adding the SDK within your project and then starting the Kochava Tracker in code. If you have already integrated the SDK and started the tracker, please visit Using the SDK and choose a topic.


Integrating the SDK

Requirements:

  • Roku OS 9.2
  • Roku SceneGraph Channel

 

Supported Platforms:

  • Roku
  • Roku TV

Integration:

5 Minutes
Estimated Time to Complete
5 Minutes

(Release Notes)

 

In order to use the Kochava SDK you must first add it to your project. This can be accomplished by downloading the SDK and copying it into your project directory.

  1. Download and unzip the Kochava Roku SDK to a known location.
  2. Copy the components/kochava directory into the components directory of your project.
  3. Copy the source/kochava directory into the source directory of your project.
  4. Import the KochavaSdk.brs script in your primary scene xml file.
  5. <script type="text/brightscript" uri="pkg:/source/kochava/KochavaSdk.brs"/>

Starting the Tracker

1 Minute
Estimated Time to Complete
1 Minute

Once you have added the Kochava SDK to your project, the next step is to configure and start the Kochava Tracker in code. Only your App GUID is required to start the tracker with the default settings, which is the case for typical integrations.

We recommend starting the tracker within the primary scene init function, although this can be done later if needed. Starting the tracker as early as possible will provide more accurate session reporting and help to ensure the tracker has been started before using it.

kochava = GetKochavaInstance()
kochava.tracker.startWithAppGuid("_YOUR_APP_GUID_")

 

BEST PRACTICES: The SDK’s API can only be used from the channel’s Render thread.


Confirm the Integration

After integrating the SDK and adding the code to start the measurement client, launch and run the app for at least 10 seconds or more. During this time the client will start and send an install payload to Kochava. To confirm integration was successful, visit the app’s Install Feed Validation page Apps & Assets > Install Feed Validation. On this page you should see one of two integration messages, indicating integration success or failure.

 

Integration Successful:

 Integration Success!

 

Along with this message you will also see a variety of data points associated with the device used for testing. At this point your integration is successful and you can proceed to the next step(s).

NOTE: It may take a few minutes for the first install to appear within the Install Feed Validation page. If you do not see this message immediately, you may simply need to wait a few minutes and check again.


Integration Not Complete:

 Integration Not Complete!

 

If you encounter this message, please review the integration steps, uninstall and reinstall the app, and check again.

 

 

Where to Go From Here:

Now that you have completed integration you are ready to utilize the many features offered by the Kochava SDK. Continue on to Using the SDK and choose a topic.


Custom Tracker Configuration

Below is a list of all configuration options and their default settings. Keep in mind that in a typical integration these configuration settings should not be adjusted from their default values.

Default — None

This string should be set to your Free App Analytics App GUID, which can be found in your Edit App page within the Free App Analytics dashboard. This value is always required (unless a Partner Name is set).

kochava.tracker.startWithAppGuid("_YOUR_APP_GUID_")

Default — Info

kochava.setLogLevel(kochava.LogLevel.Trace)

Set this value to the desired Log Level to be used by the SDK for debugging purposes. The log level should be set prior to starting the SDK, but can be changed at any time.

For complete details and examples, see: Enabling Logging

Default — None

kochava.tracker.registerCustom("key", "value")

This is a reserved setting and should not be set unless provided by your Client Success Manager.

Default — None

kochava.tracker.startWithPartnerName("_YOUR_PARTNER_NAME_")

This is a reserved value and should not be set unless provided by your Client Success Manager.

 
 

Last Modified: Dec 6, 2022 at 11:45 am