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:
Release notes
For a complete release history, including new features, improvements, and bug fixes, see the FastPix dashjs data SDK CHANGELOG on GitHub.