Monitor DASH.js
FastPix Video Data SDK for dash.js helps you track and analyze video playback metrics in real time. It gives you clear insights to improve performance, reduce errors, and deliver a smooth viewing experience.
Key features:
- Get insights into how users interact with your videos.
- Track real-time metrics like bitrate, buffering, startup, render quality, and failures.
- Identify and fix video delivery bottlenecks.
- Get detailed error logs to quickly identify and fix issues that interrupt playback.
- Customize tracking to match your specific business needs.
- View and compare metrics to make data-driven decisions.
Install and setup
Import the SDK
Basic integration
Include metadata
Advance customization
Emit custom events
Configure SDK
Step 1
Install and setup
Step 2
Import the SDK
Step 3
Basic integration
Step 4
Include metadata
Step 5
Advance customization
Step 6
Emit custom events
Detailed example
Configure SDK
PREREQUISITES
Before integrating the SDK, you need a Workspace Key to enable tracking and analytics.
Learn about Workspaces.
- Log in and navigate to the Workspaces section.
- Copy the Workspace Key for client-side monitoring. Include this key in your JavaScript integration wherever video tracking is required.
Step 1: Installation and setup
You can install the package using npm, a CDN, or any tool you prefer.
View GitHub repo.Using npm:
Using CDN:
PLEASE NOTE
Ensure that a package based on DASH Player is installed or accessible via a CDN.
Step 2: Import the SDK
Step 3: Basic integration
The workspace_id is required and must be included. To get started, install the dash.js package, import the dashjs constructor, and use it to initialize the player and attach it to your HTML5 video element. Then, pass both the dashjs player instance and constructor along with your custom metadata to the fastpixMetrix.tracker function.
Once the player loads the video URL and playback begins, the FastPix SDK will automatically start tracking analytics.
After completing Step 3, FastPix will automatically start capturing viewer metrics, which will appear in your Video Data dashboard once playback ends.
You can further enhance your integration by following Steps 4, 5, and 6 — these are optional but recommended for advanced tracking and customization.
Step 4: Enhance tracking with metadata
Check out the user-passable metadata documentation to see what metadata FastPix supports. You can use custom fields like custom_1 to custom_10 for your specific needs, or directly pass standard attributes like video_title, video_id, etc.
DEVELOPMENT TIP
Keep metadata consistent across different video loads to make comparison easier in your analytics dashboard.
Step 5: Advanced customization with Dash.js
Enhancing your video player with advanced options can significantly improve user experience and data tracking. Below are key configurations you can implement when using the FastPix SDK with your dash.js player instance.
Example:
Step 6: Emit custom events
Custom error reporting and contextual tracking
By default, FastPix tracks playback failure errors. However, for non-critical issues that occur outside of these failures, you can trigger custom error events. This allows you to provide additional context, offering deeper insights into the playback experience and improving overall tracking accuracy.
TIP
Use custom error codes and messages that are meaningful for your debugging process to streamline troubleshooting.
Handling Video Stream Changes
When playing multiple videos consecutively, it’s essential to inform the FastPix SDK each time a new video begins to ensure precise tracking. You should notify the SDK in these situations:
- The player moves to the next video in a playlist.
- The user chooses a different video to play.
- To notify the FastPix SDK of a new video, trigger a
videoChangeevent right after the new video source is loaded.
PLEASE NOTE
Always ensure that this event is dispatched right after the new source is loaded to maintain accurate tracking.
Example to configure DASH with FastPix Data SDK
Here are platform-specific examples to help you integrate the FastPix Data SDK with your dash.js player. Use the following React or JavaScript or HTML code into your application:
Changelog
All notable changes to the DASH Player Video Data SDK is documented below.
Current version
v1.0.8
Changed:
- Switched to native
cryptoAPIs for random number and UUID generation, removing the externaluuiddependency and reducing bundle size. - Updated the default metrics collection endpoint domain.
- Added local test pages for HLS and DASH player integration.
- General code sanitization and hygiene improvements across the SDK internals to enhance reliability and long-term maintainability.
Previous versions
v1.0.7
Changed:
- Updated the SDK’s default metrics collection domain to improve endpoint reliability and alignment with current infrastructure.
- Explicitly configured custom domains continue to be respected.
v1.0.6
Changed:
- Updated npm authentication from Classic token to Granular token for improved security and fine-grained permissions.
v1.0.5
- Added support for accepting user-provided
player_software_nameandplayer_software_versionvia user-passable data.
v1.0.4
- Added
request_urlto capture each video chunk URL in hls and dash players. - Implemented strict checks for
documentandwindowobjects to ensure execution only in browser environments. - Fixed bug where
destroyHlsMonitoringcould throw a runtime error. - Updated UUID generation method to work seamlessly across both web and mobile applications.
v1.0.3
- Updated
package.jsonto include additional keywords related to video analytics, HLS, and DASH players.
v1.0.2
- Added support for DASH.js video player monitoring
- Enhanced analytics collection for DASH streams
- Improved error tracking for DASH.js players
v1.0.1
- Resolved proper cleanup of HLS streams upon the viewComplete event.
- Enhanced stream handling logic: when a new player instance is initialized while another is in progress, the SDK now correctly destroys the previous player’s data monitoring and seamlessly switches to capture analytics for the incoming player.
v1.0.0
Added:
- Integration with HLS:
- Enabled video performance tracking using FastPix Data SDK, supporting HLS streams with user engagement metrics, playback quality monitoring, and real-time streaming diagnostics.
- Provides robust error management and reporting capabilities for HLS video performance tracking.
- Allows customizable behavior, including options to disable cookies, respect
Do Not Tracksettings, and configure advanced error tracking and automatic error handling. - Includes support for custom metadata, enabling users to pass optional fields such as
video_id,video_title,video_duration, and more. - Introduced event tracking for
videoChangeto handle metadata updates during playback transitions.