Skip to main content

Get viewer engagement

This guide provides information about registering and retrieving views from a video using the dashboard or the Livepeer API.

Register viewership metrics

To collect and register viewership metrics, you first need to configure your player. It is not required but we recommend that you use the Livepeer player to get viewership metrics, as it comes fully configured for the best playback experience with Livepeer. You can follow this guide to set it up.

We also support viewership data using custom players. Here's how to configure one to register viewership metrics as well:

Here's how to configure a custom player:

import { addMediaMetrics } from 'livepeer'

const source =
'https://livepeercdn.com/recordings/bd600224-d93a-4ddc-a6ac-2d71e3c36768/index.m3u8'
const video = document.getElementById('my-video')

// setup your player before calling addMediaMetrics

addMediaMetrics(video, source, (e) => console.error('Error adding metrics', e))

The Livepeer Studio Dashboard is a frontend interface for publishing live or on-demand video streams with no code. In this guide, we'll show you how to use the dashboard to retrieve viewership metrics.

Step 1: Navigate to the Assets page

Assets page

Step 2: Click on an existing asset

Click on an existing asset and you'll be brought to that asset's specific details page. If you haven't created an asset yet, you can follow the upload a video asset guide to do so.

Assets page

Step 3: View your asset's viewership metrics

In the asset's specific detail page you can view its total number of views.

Asset views