Skip to main content

Analytics Module

This guide is intended to assist you in integrating the Analytics Module for your player to collect, analyze, and report data related to user playback behavior.
You can obtain a basic example of the Player Analytics Module through this sample project.
For basic player SDK integration, you can refer to Getting Started.

Integration Preparation

Before starting the integration, you must obtain the api token first in order to transmit player playback events to BlendVision Data Platform.

Analytics Field Definition

  • analytics.token: The field is required, this appears to be an api token or authentication key for analytics purposes.
  • analytics.sessionId: The field is optional, this represents a session identifier, likely used to track user sessions or interactions with the application.
  • analytics.resourceId: The field is optional, this could be an identifier for a specific resource or source within your application, used for tracking or categorization.
  • analytics.resourceType: The field is optional, this might indicate the type or category of the resource mentioned above.
  • analytics.<customProperty>: The field is optional, this is a placeholder for custom data that you can include in your analytics events, allowing you to send additional information as needed, for example analytics.my_log_prop will add property my_log_prop.

Initialize the Analytics Module

In your player code, make sure to load the Analytics module during the initialization phase. This typically involves importing the Analytics library, configuring it appropriately, and initializing the connection to the service.

const modulesConfig = {
["analytics.token"]: "YOUR_TOKEN",
// analytics.session_id: 'YOUR SESSION ID',
// analytics.resource_id: 'YOUR RESOURCE ID',
// analytics.resource_type: 'YOUR RESOURCE TYPE',
};

const BvPlayer = BlendVision.default;
const player = BvPlayer("my-player", {...playerConfig, modulesConfig});