CAUTION: Ad Monitoring support is not available currently. Please reach out to your Conviva representative if the support is required.
Follow these instructions to complete the Conviva VSI Sensor integration on Windows/Xbox One WinJS players.
Step 1: Install Conviva Library
Developer Steps
Step 2: Configure Metadata
Developers Steps
Step 3: Report Events and Metadata
Developer Steps
Step 4: Handle User ActionsUse Conviva methods to report custom events. Developer Steps
Step 5: Clean Up Session
Developer Steps
|
Prerequisites
Obtain your account's CUSTOMER_KEYs.**Conviva provides a test account and a production account for Test and Production environments, respectively. You can find your CUSTOMER_KEY here: Pulse - Account Info. Ask your Conviva representative for assistance if you have problems accessing it.
Pass the gatewayUrl parameter to init() method of Conviva SDK. The gatewayUrl is specific for your account and shall ONLY be used for tests, never for production deployment.
Sample gatewayUrl for Testing:
https://<*customer_key*>.ts-testonly.conviva.com
IMPORTANT: If there's any doubt on how to set the gateway URL, consult your Conviva representative - this is a critical parameter. For production, Conviva library uses the automatically-assigned gatewayUrl.
Use Touchstone 2.0 in Pulse to perform self-validation and debugging of video sensor integration
For Conviva JavaScript Sensor Integration, you can use any custom gateway URL with a proxy service setup. This is applicable for JavaScript version 4.7.13 onwards.
Plan your metadata
Conviva supports Pre-defined, Device, and Custom metadata. Work with your project team to determine the need to collect any custom metadata. It's also recommended to work with your Conviva representative to create your metadata plan prior to integration.
Integration Summary
- Install the library and add dependencies.
- Initialize the
ConvivaUWP.WinClientobject using your CUSTOMER_KEY. - Using an instance of
ConvivaUWP.WinClientreport video related events.
- Implement the metadata by following the instructions to use the pre-defined keys, as well as custom metadata if defined.
- Conviva library autocollects device metadata.
- Implement the
ConvivaUWP.WinClient.createSession(contentInfo, jsNotifier)method to report playback attempt request along with metadata (content, workflow, audience, and other relevant metadata). - Wrap the player with a monitoring proxy
ConvivaUWPJS.VideoElementConvivaStreamerProxy( player ); - Use the
ConvivaUWP.WinClient.cleanupSession()method to report the of end playback. - Implement advanced metadata and events as prescribed by the corresponding specification.
- Report ad break start / end.
- Pause/Resume monitoring of video metrics by marking the start and end of ads in the video stream.
- Conviva library autocollects Network Metrics.
- Clean Up
Call the
ConvivaUWP.WinClient.cleanupSession()andvideoElementStreamerProxy.Cleanup()API's to gracefully end the monitoring session associated with current video asset playback.
Test and Validate
After integration, perform a sanity check following the test cases in the Stream Sensor Sanity Test Plans spreadsheet. For the full validation test, use the test cases in the Stream Sensor Full Test Plans spreadsheet.
Use Touchstone in Pulse to perform self-validation and debugging of video sensor integration.
https://.ts-testonly.conviva.com
- Done! Analyse your data in Pulse and improve your viewer experience - let's make video experience better!
1. Install Conviva Library
Add Conviva Libraries and Configure Dependencies
|
Add core SDK |
Conviva Windows 10 / Xbox One WinJS library currently supports desktop systems, mobile phones, and tablets. Download and add the library explicitly: Conviva Windows 10/Xbox One: WinJS library |
|---|
|
Initialize the top level object |
Conviva initialization is a one-time call that must occur at the earliest possibility in your application's initialization flow.
No need to set gatewayUrl and LogLevel settings for your production release explicitly. The Conviva sensor has the right default value.The allowed parameters are:
Sample code illustrating initialization with/without debug:
IMPORTANT: No need to set Expected Errors Due to Dual Stack IPv4/v6 Network SupportWhen the Conviva sensor is initialized with production settings, the SDK sends a single request to the endpoints below:
Sending both requests enables correlation of IPv4 and IPv6 addresses in dual-stack networks. If only IPv4 or IPv6 addressing is used (single-stack networking), it is expected that one request will fail. All the following requests will be sent to the endpoint below which supports both IPv4 and IPv6:
|
|---|
2. Configure Metadata
Metadata enables analysis of your data using different dimensions, for example, content, audience, device, workflow, player, and operating system.
Conviva categorizes metadata tags into three buckets (Predefined, Device, Custom).
Pre-defined Video and Content Metadata
Conviva defines the constants or fixed string keys for commonly used metadata. These metadata keys provide critical information about video content, versioning, workflow.
Populate contentInfo object an instance of ConvivaUWP.WinContentInfo() with the specified metadata.
IMPORTANT: To assign content category labels, such as Audio, Trailer, Tile Play, or Short Video, use the c3.cm.categoryType pre-defined content metadata constant.
Constants for Pre-defined Video and Content Metadata
| Key | Type | Implementation Note |
|---|---|---|
| assetName | string | contentInfo.setAssetName(string assetName)
For video content, use unique name for each stream/video asset. Values are up to your choice, but a human-readable text prefixed with the unique video ID works best in most Conviva sensors.
This provides for clarity in reports and makes most popular content easily identifiable. Pattern: [videoID] Video Title
The following are typical patterns for VOD (movies and episodic content) and Live streams:
|
| isLive | integer | contentInfo.setIsLive(integer isLive);
Denotes whether the content is video on-demand or a live stream. Affects the computation and availability of the Conviva metrics.
|
| playerName | string | contentInfo.setPlayerName(string playerName)
A string value used to distinguish video players (applications). Simple values that are unique across all of your integrated platforms work best here. If the same player used across multiple platforms, e.g Tizen, LG TV, WEB, give separate names for each application / platofrm: e.g "JS Tizen", "JS LGTV", "JS WEB". Do not include the build or version number in this property. The intention is to have a simple way of differentiating data from different players / platforms. |
| viewerId | string | contentInfo.setViewerId(string viewerId)
Required for Viewers Module. A unique identifier to distinguish individual viewers or devices through Conviva's Viewers Module. The value shall be unique abstract user's identifier. If user is anonymous, do not set any value for this tag. |
| streamUrl | string |
The manifest URL of the video stream. The Conviva backend config server attempts to map a portion of StreamURL into a CDN name. For example: In the URL The URL values reported in the streamURL are case insensitive. The streamURLs with either uppercase or all lowercase are acceptable. |
| defaultCDN | string | contentInfo.setDefaultCDN(string defaultCDN)
This value specifies the video server or CDN name from where the streaming resource is played. Set this field when the video server resource cannot be inferred from the STREAM_URL. For example, if the streamURL is The DEFAULT_Resource value is case sensitive. If the resource name is initially reported as AKAMAI (uppercase) and subsequently modified in the app to akamai (lowercase), it is necessary to inform Conviva about the change because both need to be mapped in the Conviva backend configuration server to ensure that both point to the same CDN name (AKAMAI).
|
| duration | integer | Autocollected by the Conviva library.contentInfo.setDuration(integer duration)
Duration of the video content, in seconds. |
| Player Framework Name | string | Autocollected by the Conviva library. |
| Player Framework Version | string | NOTE: Refer to the existing Limitations. |
| "c3.app.version" | string | contentInfo.setTag("c3.app.version", string value)
Application build version. |
| "c3.cm.contentType" | string | Advanced content delivery methods along with Live and VOD.
Acceptable values: "Live", "Live-Linear", "DVR", "Catchup", "VOD". |
| "c3.cm.channel" | string | The channel on which the content is consumed.
Example: "ABC". |
| "c3.cm.brand" | string | The name of the brand to which the content belongs.
Examples: "ABC X", "ABC Y". |
| "c3.cm.affiliate" | string | Affiliate or MVPD name for TV Everywhere authenticated services.
Examples: "Xfinity", "Comcast". |
| "c3.cm.categoryType" | string |
Content business categories of interest. Use this constant to assign content category labels, such as Audio, Trailer, Tile Play, or Short Video. Examples: "Episodic", "Movies", "News", "Sports", "Events", "Informercials", "Shorts", "Promos", "Audio", "Tile Play", "Short Videos", "Trailer". |
| "c3.cm.name" | string | Name of CMS Provider.
Examples: "CMS", "ROVI", "TMS". |
| "c3.cm.id" | string | Unique asset identifier to query CMS system to gather additional asset metadata information for a specific asset.
Example: "003b094d-fc5c-3d5a-8ed0-301bf848291e". |
| "c3.cm.seriesName" | string | The name of Series. Set the value only if the metadata cannot be gathered from CMS System. Null if not applicable.
Examples: "Friends", "Null". |
| "c3.cm.seasonNumber" | string | The Season number. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.
Examples: "1", "Null". |
| "c3.cm.showTitle" | string | The name of the Episode or Show Title. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.
Examples: "The One with All the Cheesecakes", "Null". |
| "c3.cm.episodeNumber" | string | The Episode number. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.
Examples: "3", "Null". |
| "c3.cm.genre" | string | The Primary content genre. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.
Examples: "Drama", "Null". |
| "c3.cm.genreList" | string | The list of the applicable content genre. Set the values in a comma separated list only if the details cannot be inferred from Asset Provider Server. Null if not applicable.
Examples: "Drama, Crime, Political, Violence", "Null" |
| "c3.cm.utmTrackingUrl" | string |
Provide the UTM parameters in the URL to track the effectiveness of the online marketing campaign across traffic sources and publishing media. Conviva uses CONTAINS logic to parse the individual UTM parameters from the URL provided, so either the full URL or just the UTM parameters is acceptable.
Example values: This tag is only applicable for web and mobile devices. |
Custom Metadata
Refer to App Manager->Setup Metadata page for your account to find the custom tags which shall be implemented.
Set custom tags in a similar way for video, by adding the tags to the contentInfo object, passed into corresponding methods of ConvivaUWP.WinClient object.
c3.cm format, for instance, c3.cm.MyCustomTag1. Conviva reserved the c3.cm naming convention for the pre-defined or required metadata.Update/Amend Metadata
To update or amend pre-defined and custom tags for video, use ConvivaUWP.WinClient.updateContentInfo(this.sessionId, contentInfo):
sessionId: previously referenced sessionId during createSession call.contentInfo: map containing the key - value pairs of metadata tags for video content.
Refer to the below example of setting pre-defined and custom metadata for video:
// Fetch metadata from CMS and pass non-null values to Conviva
// WinContentInfo Metadata Creation Block
var contentInfo = new ConvivaUWP.WinContentInfo();
// required: unique value for every asset
if (assetName != null) {
contentInfo.setAssetName(assetName);
}
// highly recommended: dictionary of your custom metadata key/value string pairs
for (var key in customMetadata) {
var value = customMetadata[key];
if (key != null && value != null){
contentInfo.setTag(key, value);
}
}
// required: e.g. "http://your.cdn.com/stream.m3u8"
if (streamURL != null){
contentInfo.setStreamURL(streamURL);
}
// required: 1 for live content, 0 for VOD content
if (isLive == 1 || isLive == 0){
contentInfo.setIsLive(isLive);
}
// required: e.g. "Windows10 UWP JavaScript App"
if (playerName != null) {
contentInfo.setPlayerName(playerName);
}
// required for Viewers Module: e.g. "john@doe.com" or "12345"
if (viewerId != null) {
contentInfo.setViewerId(viewerId);
}
// optional: needed when the content's stream URL patterns
// are not sufficient to identify the CDN
if (defaultCDN != null) {
contentInfo.setDefaultCDN(defaultCDN);
}
//optional: needed when the content length is accurately
//present with application
if(contentLength != null) {
contentInfo.setDuration(contentLength);
}
ConvivaUWP.WinClient.updateContentInfo(this.sessionId, contentInfo);
IMPORTANT: Please note that different Conviva products, such as Conviva VSI and Conviva Viewer Insights may have different logic with respect to handling updated values. Conviva recommends to update the metadata only when it is available and do not set any default values before the metadata is available.
Ad Events and Metadata
Report Ad Break
An ad break is a single or a sequence of ads in the video stream. We are able to record ad break metadata like: planned ad break duration (podDuration), ad break position (podPosition), relative ad break index (podIndex) and absolute ad break index (absoluteIndex). To collect the ad break metadata, notify Conviva of the start and end of an ad break.
Refer to the code examples below for Monitoring Ad Breaks:
// Sample Event for Ad Pod Start
var podStart = new Windows.Foundation.Collections.StringMap();
podStart.insert("podDuration", "60");
podStart.insert("podPosition", "Pre-roll");
podStart.insert("podIndex", "1");
podStart.insert("absoluteIndex","1");
//SessionId should be valid
ConvivaUWP.WinClient.sendEvent(sessionId, "Conviva.PodStart", podStart);
// Sample Event for Ad Pod End
var podEnd = new Windows.Foundation.Collections.StringMap();
podEnd.insert("podPosition", "Pre-roll");
podEnd.insert("podIndex", "1");
podEnd.insert("absoluteIndex","1");
//SessionId should be valid
ConvivaUWP.WinClient.sendEvent(sessionId, "Conviva.PodEnd", podEnd);
Pause Content Monitoring
If you have content with ads, please review the steps in Pause Content Monitoring below. These steps are not needed if you do not have ads in your video content.
The following step is required when the video content contains pre-roll and mid-roll ads.
Handling Pre-Rolls
A common way to handle pre-roll ads is to preload the main content, pause it while the pre-roll ad plays, and then resume the main content after the pre-roll completes. Essentially, the ad plays while the main content is loaded. However, you don't want the play time for the ad to be counted as part of the Video Startup Time metric, nor do you want to be constantly polling the player while the ad runs.
The solution is to notify the Conviva layer of the pre-roll's existence and its start and end events.
// As soon as ad playback starts, add these two calls
ConvivaUWP.WinClient.adStart( sessionId ); // Signal the start of ad, so ad time can be calculated
ConvivaUWP.WinClient.detachJSNotifier( sessionId ); // Pause monitoring while ad is playing
// Call after ad ends and is about to transition to main content
ConvivaUWP.WinClient.adEnd( sessionId ); // Signal the end of ad, so ad time can be calculated
ConvivaUWP.WinClient.attachJSNotifier( sessionId, jsNotifier ); // Attach main content jsNotifier for monitoring
Handling Mid-Rolls
Ads played during the viewing of content are another case that needs to be handled correctly to maintain the accuracy of viewing metrics. For example, you don't want time spent viewing an ad to be included in buffering ratio calculations. Likewise, your metrics would also be adversely affected by ending a session when an ad starts and starting a new session when it resumes.
The solution is to pause monitoring when the main content stops and a mid-roll ad starts. To resume the session, you attach either the same player instance or a new player instance when the ad stops.
// As soon as the content stops playing, call:
ConvivaUWP.WinClient.detachJSNotifier( sessionId );
// Once the ad stops playing, resume the session by attaching the new player instance:
ConvivaUWP.WinClient.attachJSNotifier( sessionId, jsNotifier );
jsNotifier instance can be a new instance or the same one that was used to create the session. However, it should not be null.3. Report Events and Metadata
Report Playback Start |
The main purpose of Conviva Integration is to measure the quality of experience by monitoring videos from the moment user initiates playback. Use the following method create session to monitor video playback:
The keys / methods and expected values of the required metadata tags are defined in the Implement Metadata section below. IMPORTANT:
IMPORTANT: It's critical to make this API call correctly to monitor video experience - monitoring session created from this moment, and key metrics are captured based on this event. For example, if this call done late (say, when video starts rather than user clicks "play"), the Video Startup Time will be under-reported, Video Start Failures will be missed, etc. Please note that each video should be monitored separately - call this method for each new video played. IMPORTANT: If some of the content metadata tags aren't available at start, they can be set later or amended by
|
||||||||
|---|---|---|---|---|---|---|---|---|---|
|
Report Playback Start with Deferred Streamer Attachment |
In certain scenarios, you create a video session but attach your player instance at a later stage, after checking for any errors that might occur after session creation but before streamer attachment. This is common when you use a DRM, when you create the player/streamer instance after a successful DRM validation. In such cases, you still create the monitoring session with its metadata as soon as the user has expressed intent to play the video (whether via auto-play or manually) but you attach your player/streamer instance via another method call, after manually reporting any errors that may have prevented successful playback. We count these errors with their corresponding messages - as Video Start Failures (VSFs). If you are using Your code will look similar to:
|
||||||||
|
Report Playback End |
Report end of playback by using the method:
|
Implement Advanced Metadata and Events
|
Set Bitrate |
HLS/DASH with AdaptiveMediaSourceHTML5
If you change the
HLS/DASH without AdaptiveMediaSourceTo report bitrates for an HLS stream when you are not using the Smooth StreamingFor MP4 and Smooth Streaming, the Conviva library does not automatically detect the display or playing bitrate due to a limitation of Windows UWP/Smooth Streaming Client SDK API. To report bitrate information from another source, use the
For Smooth Streaming, the playing bitrate is defined as the total playing bitrate, including both audio and video tracks. |
|---|---|
Report Seek Events |
Fatal errors are any events preventing the user from seeing the video they attempted to play or any non-user event that causes midstream video playback failure (after the video starts successfully). These fatal errors should be reported and will be used to calculate Video Playback Failures (VPF) and Video Start Failures (VSF) metrics in Conviva VSI. Sample code for DRM Error reporting
|
|
Exception Handling |
For API calls from the ConvivaUWP namespace, the Conviva library silently suppresses underline exceptions from the DLL library. For the JavaScript library API calls from the ConvivaUWPJS namespace, you may want to catch these calls to troubleshoot your Conviva integration.
|
|
Report CDN Server IP |
The Conviva WinJS library depends on the application to report CDN server IP. When the CDN Server IP is available to the application, the same can be reported to Conviva. The CDN Server IP is of type String and is set as attribute of the ConvivaUWP.WinClient class, which provides the following method.
The following code sample reports CDN Server IP to the Conviva WinJS library:
|
|
Report Dropped Frames Count |
The dropped frames count for a specific interval is reported periodically. The Conviva WinJS library depends on the application to report the dropped frames count. The dropped frames count is of the type Integer and is set as an attribute of the ConvivaUWP.WinClient class, which provides the following method:
The following code sample reports the dropped frames count to the Conviva WinJS library:
|
4. Handle User Actions
Report Network Metrics
The Conviva library automatically detects the network connection type only for Windows 10 devices (Ethernet, WiFi, 3G, OTHER). The Conviva library reports the raw values returned by the WWAN network connection data service class.
Use the following Conviva mapping to reference the raw values:
| Raw Value | Mapping |
|---|---|
| WiFi | WiFi |
| Cdma1xEvdo | 3G |
| Cdma1xEvdoRevA | 3G |
| Cdma1xEvdoRevB | 3G |
| Cdma1xEvdv | 3G |
| Cdma1xRtt | 3G |
| Cdma3xRtt | 3G |
| CdmaUmb | 3G |
| Edge | 2G |
| Gprs | 2G |
| Hsdpa | 3G |
| Hsupa | 3G |
| LetAdvanced | 4G |
| Umts | 2G |
| Custom | Other |
Report Custom Events
Player Insight is an advanced feature which allows you to track custom events that are not related to video rendering, but rather specific to your player's functionality. These events and their attributes are then tabulated in the Player Insight dashboard at Conviva VSI (Pulse). Contact your Conviva representative to enable Player Insights in Pulse.
You may send a custom Player Insight event that can be associated with a video playback using the following method:
Report video-related events by the method ConvivaUWP.WinClient.sendEvent(this.sessionId, eventName, /* Windows.Foundation.Collections.StringMap */ stringMap):
Following is an example of a custom event named "TestEvent", with two attributes:
// prepare the eventAttributes parameter:
var stringMap = new Windows.Foundation.Collections.StringMap();
// loop over key/value pairs
stringMap.insert(“attr1”, “value1”);
stringMap.insert(“attr2”, “value2”);
ConvivaUWP.WinClient.sendEvent(sessionId, “TestEvent”, stringMap);
You may send a custom Player Insight event specific to your player's functionality, but not associated with a monitoring session by passing "0" (integer) for sessionId:
ConvivaUWP.WinClient.sendEvent(0, "TestEvent", stringMap);
5. Clean Up Session
Each monitoring session needs to be cleaned up once the video stream it's attached to is no longer used. Depending on how the app/player is set up, this step may occur at the end of playback, during player deallocation, or before transitioning to a different stream.
The method signature is:
ConvivaUWP.WinClient.cleanupSession( sessionId );
sessionId = -1;
// Don’t forget to cleanup streamer proxy instance.
videoElementStreamerProxy.Cleanup();
videoElementStreamerProxy = null;
Advanced Use Cases
You can use specific APIs in the Conviva sensor for various advanced use cases, such as:
- Live or live linear streaming program changes
- Video changes in the playlist
- Playback does not recover from error and is reported once only
- Multiple errors due to retrying when playback does not recover
- Playback recovers from a fatal error by switching to a different asset URL or CDN
- A warning occurs when there's no impact on the playback
- Handling user actions, such as user dialogues
To learn more about these advanced use cases, see here.
Limitations
| Metric Name | Impact | Conditions | Issue |
|---|---|---|---|
| Average Bitrate | Under-reported | HLS/DASH | HTML5 Windows.Media.Streaming.Adaptive class doesn't report audio bitrate. Conviva's bitrate calculations include both video and audio data. |
| Not reported | Smooth Streaming (SS) | Smooth Streaming SDK doesn't report bitrate for SS streams. Please update the stream bitrate manually using the guidelines under Set Bitrate section. | |
| Average Frame Rate | Not reported | All | Player doesn't support an API to fetch frame rate information. |
| Average % Complete | Over-reported | Background | The player reports PLAYING state even when the application is in the background or sleep-mode or the device is locked. |
| Minutes/Unique Device | Over-reported | Background | The player reports PLAYING state even when the application is in the background or sleep-mode or the device is locked. |
| Minutes/Ended Play | Over-reported | Background | The player reports PLAYING state even when the application is in the background or sleep-mode or the device is locked. |
| Total Minutes | Over-reported | Background | The player reports PLAYING state even when the application is in the background or sleep-mode or the device is locked. |
| Metadata Name | Impact | Conditions | Issue |
|---|---|---|---|
| Device Type | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Browser Name | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Browser Version | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Device Manufacturer | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Device Name | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Device Marketing Name | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Device Hardware Type | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Device Operating System | Not reported | All | The player doesn't support User Agent String (UAS), where this metadata would be collected from. |
| Framework Version | Not-reported | First heartbeat | The player doesn't provide Framework Version. |
| Device Connection Type | Not-reported | Xbox | Device Connection Type is not detected on an Xbox device. |
| Link Encryption | Not-reported | Xbox | Link Encryption is not detected on an Xbox device. |
| Screen Resolution | Not-reported | Xbox | Screen resolution is not detected on Xbox devices. |
Self Validation
Upon completion of your integration, and before submission to Conviva QA team, developers should complete a comprehensive self-validation test pass of each Device Application.
Perform self-validation of video sensor integration using Touchstone in Pulse.
Conviva provides sample test cases with detailed steps and expected results.
Developers should be checking for both metric and metadata accuracy. Based on our experience, comprehensive self-validation can reduce your QE cycles, saving your costly project time.