This guide describes how to set up the Android Collector v3. You can find a guide for the deprecated v2 collector [here](🔗).

# How to set up Analytics on Android

Bitmovin Analytics enables you to get useful insights into the video experience in your apps. The Bitmovin Player for Android includes Analytics pre-integrated. Players like ExoPlayer, Media3 ExoPlayer, and the Amazon IVS player can be tracked through our player-specific collectors.

In order to complete 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 page first: [Bitmovin Player getting started guide](🔗), [ExoPlayer documentation](🔗), [Media3 ExoPlayer documentation](🔗), [Amazon IVS Player documentation](🔗).

You also need to set up your analytics license and allowlist your domain. If you haven't done this yet, go to our [How to Set Up](🔗) page and follow the steps there.

### Platform requirements:

CollectorSupported Android Version
Bitmovin Player CollectorAndroid 5+
ExoPlayer CollectorAndroid 5+
Media3 ExoPlayer CollectorAndroid 5+
Amazon IVS Player CollectorAndroid 5+

# Bitmovin Player

## Step 1: Configure Analytics

Starting with version `3.41.0` of the player, Analytics comes pre-integrated in the player. You just need to enable Analytics during creation of the Player.

#### Enable Analytics for the Player

For a minimal setup, only the license key needs to be specified. For more analytics configuration see [here](🔗). This minimal setup is enough to enable basic tracking.



#### Enrich analytics data with Metadata

In order to enrich analytics with more data, `DefaultMetadata` and `SourceMetadata` can be set.

`DefaultMetadata` can be set during player creation, and this contains source independent data (e.g.:



`SourceMetadata` can be set for each source to add more source-specific metadata.



## Step 2: Check Statistics in Dashboard

After the setup is done there's nothing more to do. Events are recorded automatically and you can head over to the [Analytics Dashboard](🔗) to see your metrics.

# 3rd Party Players

## Step 1: Add the SDK to Your Project.

#### Add the Bitmovin release repository to your project

Add a link to our release repository to your application's `build.gradle` file. In addition to that, the Google maven repository must be added.



#### Add the Dependency to the Project

Add the Bitmovin Analytics Android SDK as a dependency to your main project's `build.gradle` file as shown below, while replacing `{Version Number}` with the desired SDK version number. The available SDK versions are listed in our [Release Notes](🔗). We recommend to always stay up to date with both player and collector versions. However if you are using an older player version, check out which collector version you should use at our [Android Collector Github page](🔗).



## Step 2: Setup the Collector

First create a basic `AnalyticsConfig` object 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](🔗).

Please replace `ANALYTICS_LICENSE_KEY` with a license key from your account. Please checkout [How to set up](🔗) to learn more about how to get to your analytics license.

Create the collector object by passing the config object. Finally attach your player to the collector. Always detach your player from the collector once you are done, e.g. when calling the `player.release()` method.



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



## 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](🔗).