> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Monitor video data

> Learn how to enable playback analytics in the FastPix Android Player using the FastPix Data Core SDK.

Learn how to enable playback analytics in the FastPix Android Player using the FastPix Data Core SDK.

The FastPix Android Data Core SDK captures playback analytics automatically, including playback lifecycle events (play, pause, ready, complete, errors), buffering behavior, seek patterns, and engagement signals. The SDK sends collected data to your FastPix workspace for near real-time monitoring through the dashboard.

The integration is lightweight and doesn't interrupt or degrade playback. If analytics setup fails at runtime, playback continues. Analytics is fail-safe by design.

## When to use analytics

Use analytics when you want to:

* Measure viewer engagement and completion trends.
* Detect buffering and quality-of-experience issues.
* Correlate playback behavior with video metadata (for example, title and ID).
* Monitor player health and failures in production.

## Configure analytics

Set up analytics using `AnalyticsConfig` and pass it to `FastPixPlayer.Builder`:

```kotlin
import io.fastpix.data.domain.model.VideoDataDetails
import io.fastpix.media3.analytics.AnalyticsConfig
import io.fastpix.media3.core.FastPixPlayer

val videoDataDetails = VideoDataDetails("video-123", "Launch Demo")

val analyticsConfig = AnalyticsConfig.Builder(
    playerView = binding.playerView,         // Optional
    workSpaceId = "your-workspace-id"        // Required
)
    .setVideoDataDetails(videoDataDetails) // Optional metadata
    .setEnabled(true)                      // Default is true
    .build()

val fastPixPlayer = FastPixPlayer.Builder(this)
    .setAutoplay(true)
    .setLoop(false)
    .setAnalyticsConfig(analyticsConfig)
    .build()

binding.playerView.player = fastPixPlayer
```

## Required and optional parameters

* **`workSpaceId`** is mandatory.
* **`playerView`** is optional. Use the two-argument constructor `AnalyticsConfig.Builder(playerView, workSpaceId)` when a single view shows the player. Use the single-argument constructor `AnalyticsConfig.Builder(workSpaceId)` (no view) when the player is shown in different views over time, as with a `FastPixPlayerPool`, where each page's view is measured through the `PlayerView` showing it.
* **`videoDataDetails`**, **`playerDataDetails`**, and **`customDataDetails`** are optional and can be added based on your use case.

> **Note:** Since 2.2.0, a view begins when the first video starts, not when the player is built. A player that never plays anything reports nothing.

## One view per video watched

Analytics reports one view for each video the user actually watches:

* A view begins when a video starts playing. That happens when you set it with `setMediaItem` or `setFastPixMediaItem`, when it is reached in a playlist (through `setPlaylist`, `next()`, `previous()`, `skipTo()`, or auto-advance), or when it is made current in a `FastPixPlayerPool` through `setCurrentIndex`.
* A view ends when playback moves to another video, the playlist is cleared, or the player is released.
* Entries that are only preloaded or pre-rendered are never reported.

The FastPix Data SDK reports one view at a time per app. Beginning a view on one player ends any view still open on another.

### Add per-entry metadata

Give each playlist entry its own metadata with `PlaylistItem.withVideoData(...)`. When an entry has no metadata of its own, `setVideoDataDetails` on the config is the fallback, and failing that the entry id is reported:

```kotlin
player.setPlaylist(
    episodes.map { episode ->
        PlaylistItem.fastPix(episode.playbackId)
            .withVideoData(VideoDataDetails(videoId = episode.id, videoTitle = episode.title))
    }
)
```

For more on building and editing playlists, see [Manage playlists](/docs/android-player/manage-playlists).

## Analytics in a feed (FastPixPlayerPool)

A pool's players move between pages, so build the config without a view. Each page's view is measured through the `PlayerView` showing it. Pass the config to the pool:

```kotlin
val pool = FastPixPlayerPool.Builder(context)
    .setAnalyticsConfig(AnalyticsConfig.Builder("your-workspace-id").build())
    .setPrerenderConfig(PrerenderConfig(count = 1, behind = 1))
    .build()

pool.setPlaylist(
    reels.map { reel ->
        PlaylistItem.fastPix(reel.playbackId)
            .withVideoData(VideoDataDetails(videoId = reel.id, videoTitle = reel.caption))
    }
)
```

Each page the user lands on is one view, and swiping away ends it. Pages pre-rendered off screen are not views, so pre-rendering does not inflate view counts.

For the full feed setup, see [Build video feeds](/docs/android-player/build-video-feeds).

## Notes

* If analytics setup fails at runtime, playback continues. Analytics is fail-safe by design.
* Current analytics APIs are optimized for Java-first Android integration.

\


#### Frequently asked questions

Build an `AnalyticsConfig` with your `workSpaceId` (and optionally the `PlayerView`), then pass it to `FastPixPlayer.Builder(...).setAnalyticsConfig(...)`. Analytics starts automatically and does not interrupt playback.

A view begins when a video starts playing, whether through `setFastPixMediaItem`, playlist navigation, or `setCurrentIndex` in a pool. Preloaded and pre-rendered entries are never counted, so a view maps to one video the user actually watched.

No. Only `workSpaceId` is mandatory. Pass a `PlayerView` for a single view, or omit it and use `AnalyticsConfig.Builder(workSpaceId)` when players move between views, as in a `FastPixPlayerPool`.

No. Analytics is fail-safe by design. If setup fails at runtime, playback continues without interruption.

\


## What's next

* [Play a playlist](/docs/android-player/manage-playlists) to give each entry its own metadata for analytics.
* [Build video feeds](/docs/android-player/build-video-feeds) to measure one view per video the user lands on.
* [Preload and cache for faster startup](/docs/android-player/preload-and-cache-for-faster-startup) to speed up playback without inflating view counts.