# How to setup the Roku Collector

Bitmovin Analytics enables you to get useful insights into the video usage in your apps. Our Roku Collector offers a simple integration with our Bitmovin Player and the native Roku Player.

In order to follow along this guide you need at least a basic setup of your chosen Player. If you haven't set up your Player yet go to the corresponding Player documentation pages: [Bitmovin Player getting started guide](🔗), [Roku documentation](🔗).

For Roku collector when adding your domain to the allow-list in the [Bitmovin dashboard](🔗), the domain is your channel id and it must be postfixed with `.roku` . During local development the domain is defined as `dev.roku`.

## Step 1: Add Collector Folders to you project

Go to the [Github Repository](🔗) of the Bitmovin Analytics Roku Collector and download the whole project to your machine.

If you are using our Bitmovin Player, copy the `collectorCore` and the `bitmovinPlayerCollector` folders into the components folder of your Roku app.

If you are using Native Roku Player, copy the `collectorCore` and the `nativePlayerCollector` folders into the components folder of your Roku app.

## Step 2: Setup the collector

### Initialise Collector

First create a Bitmovin Analytics configuration object. Replace `INSERT_LICENSE_KEY_HERE` with your analytics license key. You can further customise it by adding optional configuration parameters. For more information and a complete list of configuration fields see our Configuration Guide [Configuration Guide](🔗).

Or configure the license key in the `manifest` file located in the root folder of the project.

Then create a collector object. To start monitoring the player, call the `initializeAnalytics` function with the analytics configuration object, and then the `initializePlayer` function with your player object as an argument.

For Bitmovin Player this must happen **before** the setup function is called on the player.

For Roku Player this must happen **before** any content is set on the player.

### Video source changes

When switching to a new video we recommend that you follow the sequence of events below.

### Clean up the collector

For Native Roku Player clean up the analytics collector when it is no longer needed before removing the native video element.

## Step 3: Check Statistics in Dashboard

After the setup is done there is nothing more to do. Events are recorded automatically and you can head over to the [analytics dashboard](🔗) to see statistics.

## Examples

You can find fully functional code examples in our [Github Repository](🔗).