Conviva JavaScript thePlatform Plugin Sensor Integration

Explains how to integrate the Conviva sensor with the thePlatform JavaScript player plugin to collect video streaming experience data.

Updated 2026-08-03 web, theplatform, stream, sensor, sensor developer center, sensor integration, web theplatform
This documentation is for JS SDK 4.0.3 and above.

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

    1. Install Conviva Library
    • Download the library and add dependencies.

    • Initialize Conviva using the CUSTOMER_KEY.

    1. Configure Metadata
    • Implement the metadata by following the instructions to use the pre-defined keys, as well as custom metadata, if applicable.

    • Implement device metadata. By default, Conviva thePlatform modules autocollects few device metadata.

    1. Handle User Actions
    • Implement the Conviva.Analytics.reportAppBackgrounded() / Conviva.Analytics.reportAppForegrounded() methods to report background events.

    • Implement the Conviva.Analytics.reportAppEvent() method to report app events (user actions, user dialogue, etc).

    • Implement the videoAnalytics.reportPlaybackEvent() method to report user events (user actions, user dialogue, etc).

    • Report Network Metrics.

    • Manage Data Collection and User Preferences.

    1. Cleanup
    • No action required from application as Conviva thePlatform plugin handles cleanup of Conviva.

    1. Install Conviva Library

    Add Conviva Libraries and Include the Plugin

    Add the Conviva Libraries

    You can add the Conviva libraries by choosing one of the following options:

    • Install using the npm package manager
    • Install using the yarn package manager
    • Download and add the libraries explicitly from Conviva GitHub

    From thePlatform plugin module version 4.0.3 onwards, Conviva supports installation through npm and yarn package managers.

    To install using the npm package manager, use:

    npm install @convivainc/conviva-js-theplatform --save

    To install using the yarn package manager, use:

    yarn add @convivainc/conviva-js-theplatform

    To download and add the libraries explicitly from Conviva GitHub, refer:

    https://github.com/Conviva/conviva-js-coresdk

    https://github.com/Conviva/conviva-js-theplatform

    Refer to this sample code which includes the pdk player, Conviva JS SDK and Conviva thePlatform plugin:

    <script type="text/javascript" src="<PATH>/pdk/player.js"> </script>
    
    <script type="text/javascript" src="<PATH>/conviva-core-sdk.js"></script>
    <script type="text/javascript" src="<PATH>/conviva-thePlatform-plugin.js"></script>
    

    Plugin and Player Inclusions

    The code sample shows how to include conviva-theplatform-plugin in the app and also the parameters to be passed.

    // Create the plug-in with Conviva specific metadata as shown below:
    <div id="player" class="tpPlayer"
    tp:pluginConviva="type=reporting|priority=1|url={<PATH>/conviva-thePlatform-plugin.js}|
    customerId={YOUR_TEST_ACCOUNT_CUSTOMER_KEY}|
    gatewayUrl={YOUR_TEST_ACCOUNT_CUSTOMER_KEY.ts-testonly.conviva.com}|toggleTraces=true|
    assetName=[{id}] [{guid}] [{contentID}] {title}|playerName={your player name}|
    viewerId={unique viewer ID}|defaultResource={your CDN name}|
    metadataKeys=metadataKey1,metadataKey2|playerTag.key1=value1|playerTag.key2=value2|
    playerTag.c3.app.version=1.2.1|enableAdExperience=true">
    </div>
    

    Parameters to pass with tp:pluginConviva in the app:

    Key / Constant Implementation Note
    type Set as reporting. A required parameter for plug-ins. This parameter is to tell thePlatform plugin loader the type of the plugin.
    priority Set as 1. Determines the plug-in's loading priority to thePlatform plugin loader.
    url Set with the appropriate plug-in URL of the Conviva thePlatform plugin.
    customerId Set the string to identify specific customer account. Different keys shall be used for development / debug versus production environment. Find your keys on the account info page in Pulse.
    gatewayUrl

    Set the gateway url. Once enabled, the data will appear in Pulse for performing self-validation of video sensor integration. See Self-validation using Touchstone.

    Be sure to replace your TEST CUSTOMER_KEY with the PRODUCTION key to go live with your application, and generate the session traffic to the following Touchstone gateway URL:https://.ts-testonly.conviva.com
    toggleTraces Set to true for debug-level log verbosity.
    assetName Set the pattern used for the asset name autocollection logic for a session. Configure depending on your metadata strategy. If you don't provide this field, we construct the asset name in the [contentId] title format which are received from the PDK clip property. The allowed values and patterns are:
    • Any arbitrary string passed directly through the plug-in configuration.
    • Video title (surrounded by {} to denote placeholders), e.g.: {title} In this case, Clip title is used as the value.
    • The PDK clip properties (surrounded by {} to denote placeholders), for example {id}, {contentID}, {guid}.
    playerName Set a string value used to distinguish video players (applications). Simple values that are unique across all of your integrated platforms work best here. 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 Set a unique identifier required for Viewers Module 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.
    defaultResource SetVideo server resource the stream is played from.Set this field when the video server resource cannot be inferred from the STREAM_URL.
    metadataKeys Set the keys used to create custom tags for your player. It's set by a comma-delimited list of keys that will be converted to custom tags with their corresponding values. Please refer to metadataKeys section for further details.
    playerTag.{key} Set the keys used to create metadata for the player. Send as a custom tag - with its corresponding value - by creatig a unique key prefixed with playerTag. Example: "...|playerTag.playerVersion=1.0|playerTag.site=yourdomain.com|..." Please refer to PlayerTag section for further details.
    playerTag.c3.app.version Set the application build version using PlayerTag. Shall have the same value for both ads and video.
    enableAdExperience Set to true to enable Conviva to monitor ads.

    IMPORTANT: No need to set gatewayUrl and toggleTraces settings for your production release. The Conviva SDK provides the default values for production.

    Expected Errors Due to Dual Stack IPv4/v6 Network Support

    When the Conviva SDK is initialized with production settings, the SDK sends a single request to the endpoints below:

    • [customer_key].ipv4.cws.conviva.com for IPv4 only

    • [customer_key].ipv6.cws.conviva.com for IPv6 only

    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:

    • [customer_key].cws.conviva.com

    Initialize the video object

    Conviva Sdk relies on an instance of VideoAnalytics to monitor Video. Conviva thePlatform plugin handles initializing instance of VideoAnalytics and adds it to the window object as convivaVideoAnalytics so application can access it.

    Initialize the ad object

    This is only applicable if your application has ads.

    Conviva Sdk relies on an instance of AdAnalytics to monitor ad. Conviva thePlatform plugin handles initializing instance of AdAnalytics and adds it to the window object as convivaAdAnalytics so application can access it.

    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 and ad content, versioning, workflow.

    The table below provides the pre-defined metadata fields monitored for video.

    Constants for Pre-defined Video and Content Metadata

    Key / Constant Implementation Note
    Conviva.Constants.ASSET_NAME Autocollected based on the plugin parameter assetName.
    Conviva.Constants.IS_LIVE Autocollected using clip.isLive on OnReleaseStart event.
    Conviva.Constants.PLAYER_NAME Autocollected based on the plugin parameter playerName.
    Conviva.Constants.VIEWER_ID Autocollected based on the plugin parameter viewerId.
    Conviva.Constants.STREAM_URL

    Autocollected using clip.url on OnReleaseStart event.

    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 https://www.akamai.net/avengers.m3u8, akamai.net maps to the AKAMAI label. Conviva VSI users can then retrieve metrics based on the mapped CDN name (AKAMAI, in this case).

    The URL values reported in the STREAM_URL are case insensitive. The streamURLs with either all uppercase or all lowercase are acceptable.
    Conviva.Constants.DEFAULT_RESOURCE

    Autocollected based on the plugin parameter defaultResource.

    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 https://cbd12348.cdn.cms.somewebsitehostname.com/abc.txt, it is not possible to infer the AKAMAI name from the streamURL, and in such a case, it is necessary to report the DEFAULT_Resource as AKAMAI.

    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).
    Conviva.Constants.DURATION Autocollected using data.release.length on OnReleaseStart event.
    Conviva.Constants.ENCODED_FRAMERATE Not applicable as thePlatform plugin doesn't support Encoded frame rate.
    Conviva.Constants.FRAMEWORK_NAME Autocollected as "thePlatformPlayer".
    Conviva.Constants.FRAMEWORK_VERSION Autocollected using $pdk.version.
    "c3.app.version" Autocollected based on the plugin parameter playerTag.c3.app.version.

    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.

    The following metadata shall be provided for video content:

    Key Type Description
    "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: http://www.example.com/?utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale&utm_content=toplink or utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale&utm_content=toplink

    This tag is only applicable for web and mobile devices.

    Device Metadata (Click to Expand):

    Device Metadata monitored by Conviva thePlatform plugin (if applicable):

    Key Implementation Note
    BRAND Autocollected using UAS, if available.
    MANUFACTURER Autocollected using UAS, if available.
    MODEL Autocollected using UAS, if available.
    TYPE Autocollected using UAS, if available.
    OS_NAME Autocollected using UAS, if available.
    OS_VERSION Autocollected using UAS, if available.
    CATEGORY Autocollected as Conviva.Constants.DeviceCategory.WEB

    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 either video or ads, by adding the tags to the contentInfo / adInfo objects, passed into corresponding methods of videoAnalytics / adAnalytics objects.

    Conviva recommends to label the custom tags as "MyCustomTag1" or "my_custom_tag", and not use the c3.cm format, for instance, c3.cm.MyCustomTag1. Conviva reserved the c3.cm naming convention for the pre-defined or required metadata.

    We use metadataKeys and playerTag to create custom tags. You can use both methods to fit your needs and create custom tags for your sessions.

    Metadata Keys

    Populate the metadataKeys=metadataKey1 parameter with the custom keys you created when building your player. We automatically detect the values for these keys and create custom tags.

    For further custom keys guidelines, refer to thePlatform documentation pages: Player custom data, Player clip and Managing Media custom fields.

    metadataKeys allow you to have custom tags for each video/stream; when pdk player issues a request for the video data, the response contains these extra fields, which we take and create custom tags. For example, if |metadataKeys=contentType| is added to your plug-in configuration, and you have a custom field "XYZ$contentType=Trailer" for a particular video clip, we'll send our custom tag with key "contentType=Trailer". Custom tags from our perspective are just key/value string pairs - we consume whatever is sent to us and don't attempt to manipulate the data in any way.

    Player Tags

    Each unique key prefixed with playerTag. will be send - with its corresponding value - as a player-level custom tag. For example, "...|playerTag.playerVersion=1.0|playerTag.site=yourdomain.com|...".

    Update/Amend Metadata

    The device metadata shall be set before calling videoAnalytics.reportPlaybackRequested() and cannot be updated afterwards.

    To update or amend pre-defined and custom tags for video, use the videoAnlaytics.setContentInfo(/object/ contentInfo):

    • contentInfo: object containing the key - value pairs of metadata tags for video content.

    Example usage:

    var contentInfo = {};
    contentInfo[Conviva.Constants.ASSET_NAME] = "[channel_id] Live Channel Name";
    // set the values for the other pre-defined keys as appropriate
    contentInfo["c3.cm.contentType"] = "Live-Linear";
    // set the values for custom tags as required per definition for your account
    contentInfo["my_custom_tag_key"] = "my_custom_tag_value";
    
    videoAnalytics.setContentInfo(contentInfo);
    

    IMPORTANT: Please note that certain video metadata can be updated only before the player reports "play" state for the corresponding object, or can only be set once.

    In certain situations, your application may not have all the content metadata when you create the session - for example, when it fetches metadata from a content management system or it requires authentication for encrypted content. Updating metadata or setting metadata late - after session creation - is subject to certain limitations. Some metadata can be set or updated:

    • after session creation, before the first video frame is rendered

    • after session creation, anytime during video playback but only once

    The following table indicates the various update scenarios that can be seen in Pulse (Conviva VSI), for each metadata item:

    Metadata Set only once Update before first video frame Multiple updates during session
    Asset Name
    Viewer Id
    Stream Type
    Player Name
    Content Length
    Custom Tags
    Resource
    Stream Url
    Bitrate
    Dropped Frames

    You cannot currently update any other metadata items.

    Ad Events and Metadata

    This is only applicable if your application has ads and enableAdExperience is enabled.

    Conviva thePlatform plugin autocollects ad events emitted by pdk player.

    Report Ad Break

    Conviva thePlatform Plugin automatically detects ad break events and handles them accordingly.

    Implement Ad Metadata

    Conviva defines the set of the metadata keys to be used for metadata implementation. The implementation can be extended by adding custom tags - refer to Update / Amend Ad Metadata section.

    The Conviva thePlatform plugin automatically collects the available values for some of the metadata tags from pdk player.

    Some of the tags though still have to be explicitly implemented. Please refer to the table below for the metadata tag definitions and details of the implementation. No action required if implementation note says "Autocollected".

    Key / Constant Implementation Note
    Conviva.Constants.STREAM_URL Autocollected using data.URL or data.url on OnMediaLoadStart event.
    Conviva.Constants.ASSET_NAME Autocollected using data.title on OnMediaStart event.
    Conviva.Constants.IS_LIVE Autocollected as Conviva.Constants.StreamType.VOD by default.
    Conviva.Constants.PLAYER_NAME Autocollected as the same value from videoAnalytics - no need to set explicitly for adAnalytics.
    Conviva.Constants.VIEWER_ID Autocollected as the same value from videoAnalytics - no need to set explicitly for adAnalytics.
    Conviva.Constants.DURATION Autocollected using data.mediaLength on OnMediaStart event.
    Conviva.Constants.ENCODED_FRAMERATE Not applicable as pdk player doesn't support encoded framerate by default.
    Conviva.Constants.FRAMEWORK_NAME Autocollected as "thePlatformPlayer".
    Conviva.Constants.FRAMEWORK_VERSION Autocollected using $pdk.version.
    "c3.app.version" Report the application build version as custom tag using the SetAdInfo(). Shall have the same value for both ads and video.
    "c3.ad.technology" Autocollected as "Client Side".
    "c3.ad.id" Autocollected using data.guid on OnMediaStart event.
    "c3.ad.system" Autocollected as "NA".
    "c3.ad.position" Autocollected using data.adType on OnMediaStart event. Set to "Pre-roll" for preroll ads, "Mid-roll" for midroll and Post-roll" for postroll ads.
    "c3.ad.isSlate" Not applicable for the CSAI.
    "c3.ad.mediaFileApiFramework" Autocollected as "VPAID" if data.type is "application/javascript" else "NA" on OnMediaStart event.
    "c3.ad.adStitcher" Not applicable for the CSAI.
    "c3.ad.firstAdSystem" Autocollected as "NA".
    "c3.ad.firstAdId" Autocollected using data.contentCustomData['vast:wrapperAdIds'][len - 1] or data.customData['vast:wrapperAdIds'][len - 1] or data.guid on OnMediaStart event.
    "c3.ad.firstCreativeId" Autocollected using data.contentCustomData['vast:wrapperCreativeIds'][len - 1] or data.customData['vast:wrapperCreativeIds'][len - 1] or "NA" on OnMediaStart event.
    "c3.ad.creativeId" Autocollected using data.creativeId on OnMediaStart event.

    Update / Amend Ad Metadata

    Use the following method to set pre-defined and custom tags for ad content:

    adAnalytics.setAdInfo(/* object */ adInfo):

    • adInfo: object containing the key - value pairs of

    string values of tags for the Ads.

    Please refer to the below example of setting both pre-defined and custom data using this method:

    var adInfo = {};
    // set the values for custom tags as required per definition for your account
    adInfo["my_custom_tag_key"] = "my_custom_tag_value";
    
    convivaAdAnalytics.setAdInfo(adInfo);
    

    Report Ad Metrics

    Report Ad-video metrics to adAnalytics by using adAnalytics.reportAdMetric(/* Conviva.Constants.Playback / key, / integer | string | long | Conviva.Constants.PlayerState */ value...):

    • key: Conviva.Constants.Playback type.

    • val: It accepts multiple/zero values for the second argument.

    convivaAdAnalytics.reportAdMetric(Conviva.Constants.Playback.BITRATE, 1024);
    

    Refer to the list of metric keys to be implemented in the table below:

    Key Implementation Note
    adAnalytics.reportAdError() (VSF/VPF) The module listens for the video errors fired by the player using OnMediaError event callback.

    To report application level errors impacting user experience, call convivaAdAnalytics.reportAdError(/* string */ message) explicitly.

    Conviva.Constants.Playback.PLAYER_STATE Autocollected.
    Conviva.Constants.Playback.BITRATE Autocollected.
    Conviva.Constants.Playback.SEEK_STARTED Not applicable as pdk player doesn't support seek events for ads by default.
    Conviva.Constants.Playback.SEEK_ENDED Not applicable as pdk player doesn't support seek events for ads by default.
    Conviva.Constants.Playback.PLAY_HEAD_TIME Autocollected.
    Conviva.Constants.Playback.BUFFER_LENGTH Not applicable as pdk player doesn't support buffer length for ads by default.
    Conviva.Constants.Playback.RENDERED_FRAMERATE Not applicable as pdk player doesn't support rendered framerate for ads by default.
    Conviva.Constants.Playback.CDN_IP CDN IP address in string format. Can be autocollected.
    Please contact Conviva Support to enable auto collection configuration.

    3. Report Events and Metadata

    Report player metrics

    Metrics monitored by Conviva thePlatform plugin (if applicable):

    Key Implementation Note
    videoAnalytics.reportPlaybackError() (VSF/VPF) The Conviva thePlatform plugin listens for the video errors fired by the player using onMediaError and onReleaseError event callbacks.

    To report application level errors impacting user experience, call convivaVideoAnalytics.reportPlaybackError(/* string */ message) explicitly.

    Conviva.Constants.Playback.PLAYER_STATE Autocollected.
    Conviva.Constants.Playback.BITRATE Autocollected.
    Conviva.Constants.Playback.SEEK_STARTED Autocollected.
    Conviva.Constants.Playback.SEEK_ENDED Autocollected.
    Conviva.Constants.Playback.PLAY_HEAD_TIME Autocollected.
    Conviva.Constants.Playback.BUFFER_LENGTH Autocollected.
    Conviva.Constants.Playback.RENDERED_FRAMERATE Not applicable as pdk player doesn't support rendered frame rate by default.
    Conviva.Constants.Playback.CDN_IP CDN IP address in string format. Can be autocollected.
    Please contact Conviva Support to enable auto collection configuration.

    4. Handle User Actions

    Handle specific user actions such as:

    • app backgrounding / foregrounding

    • dialogues

    • pin popups

    • startover dialogues

    • video slates and so on

    Use the corresponding API as prescribed on the corresponding pages.

    User Actions: Backgrounding

    Handle backgrounding event (e.g., "home"/"power off" buttons)

    Conviva.Analytics.reportAppBackgrounded();
    

    On foregrounding

    Conviva.Analytics.reportAppForegrounded();
    

    User Actions: User Dialogue

    User Dialogues such as:

    • pin popup

    • accepting strong language / violence

    • confirming age

    • startover / resume dialogue

    Use this API on dialogue shown

    convivaVideoAnalytics.reportPlaybackEvent(Conviva.Constants.USER_WAIT_STARTED);
    
    Use this API on dialogue dismiss
    convivaVideoAnalytics.reportPlaybackEvent(Conviva.Constants.USER_WAIT_ENDED);
    

    Report Network Metrics

    Metrics like connection type which is common for all the concurrent playback within one Analytics instance can be reported.

    Connection Type can be updated after session creation, before the first video frame is rendered.

    Conviva.Analytics.reportDeviceMetric(/* Conviva.Constants.Network / metricKey, / string */ metricValue):

    • metricKey: Conviva.Constants.Network type key for reporting Network Metrics.

    • metricValue: Value of the reported network metric.

    Refer to the sample code mentioned below:

    Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE, "WiFi");
    

    The table below shows the representation string values for setting connection type:

    Internet Connection Type Representation String
    Wireless WiFi
    Wired Ethernet
    Cellular 2G 2G
    Cellular 3G 3G
    Cellular 4G 4G
    Other/Unknown OTHER

    Data Collection and User Preferences

    By default, Conviva collects a set of data for better user analytics. However, the appropriate legal agreement with Conviva is required in order for Conviva to begin collecting data that would be considered PII, personal information, personal data or the like under applicable data privacy laws such as the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA). Further below in this document, there is a description of the user-preference APIs that control data collection, including opt-out and deletion of data, in compliance with data privacy laws. These APIs are in addition to existing, offline processes for opt-out and data deletion requests.

    This document describes the identifiers that the libraries are capable of collecting, however actual collection of identifiers is contingent upon the customer's legal department providing written instructions to Conviva to begin collection. At the discretion of the customer's legal department, some or all of these identifiers may be collected. Conviva provides this flexibility to allow the customer to determine the precise identifiers to be collected.

    Send unique identifier's data such as unique identifier for a device or user, for example deviceId, Mac address, advertisingIdentifier, and other identifiers, use the Conviva.Analytics.setUniqueIdentifier(/* object / identifiers, / function */ callback=):

    • identifiers: JSON object with key value pairs of identifiers and values.

    • callback: Optional callback function that needs to be notified if the identifiers were honored or collected by Conviva. Below mentioned are the sample result messages from Conviva:

    "Data collection successful" "End-user chose to opt-out of personal data collection" "End-user used privacy settings and chose to opt-out of personal data collection"

    Refer to the sample code mentioned below:

    var identifiers = {};
    identifiers["androidId"] = "xyzabd123cvqn";
    Conviva.Analytics.setUniqueIdentifier(identifiers, function (msg) {
    console.log("Result of the setUniqueIdentifier API:" + msg);
    });
    

    Control the data collection, set the user preference to collect or stop collecting PII data items using Conviva.Analytics.setUserPreferenceForDataCollection(/* object / identifiers, / boolean */forAllApps):

    • identifiers: string key/value pair, where key indicates a probable data name and value is false/true. A value of false causes the SDK to stop collecting that specific data item.

    • forAllApps: boolean value indicates if the preference applies to current app or all apps on the device. A value of true indicates all apps; false indicates only the current app.

    Refer to the sample code mentioned below:

    var identifiers = {};
    identifiers["androidId"] = "false";
    Conviva.Analytics.setUserPreferenceForDataCollection(identifiers, false);
    

    Set the user preference to delete and stop collecting specific data items using Conviva.Analytics.setUserPreferenceForDataDeletion(/* object */ identifiers):

    • identifiers: string key/value pair, where key indicates a probable data name and value is false/true. A value of false causes the SDK to stop collecting that specific data item.

    Refer to the sample code mentioned below:

    var identifiers = {};
    identifiers["androidId"] = "true";
    Conviva.Analytics.setUserPreferenceForDataCollection(identifiers);
    

    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 videoAnalytics.reportPlaybackEvent(/* string / eventType, / object */ eventDetail=):

    • eventType: Mandatory argument of event type of the video player event of string type.

    • eventDetail: Optional argument of event details of the video player event of object type.

    Report video-related events

    // Sample code snippet illustrating event on explicit change of video quality in the player for video
    var eventType = "fullscreen";
    var attr = {};
    attr["old_quality"] = "SD";
    attr["new_quality"] = "HD";
    attr["player"] = "WEB player";
    
    convivaVideoAnalytics.reportPlaybackEvent(eventType, attr);
    

    Report app-level events by the method Conviva.Analytics.reportAppEvent(/* string / eventType, / object */ eventDetail=):

    • eventType: Mandatory argument of event type of the app event of string type.

    • eventDetail: Optional argument of event details of the app event of object type.

    Report app-level events

    / Sample for "share-click" event with 3 arguments
    var eventType = "share-click";
    var attr = {};
    attr["location"] =  "Toolbar";
    attr["assetName"] = "Sample Video";
    attr["shareService"] = "Facebook";
    Conviva.Analytics.reportAppEvent(eventType, attr);
    

    5. Cleanup

    When the video playback ends, thePlatform Plugin cleans up videoAnalytics, adAnalytics and cleans up Conviva SDK on pdk player event OnPlayerDestroyed event which is raised when player gets destroyed.

    Limitations

    Known Conviva thePlatform Plugin limitations:

    Metric Name Impact Conditions Issue
    Average Bitrate Not reported HLS protocol, Safari and Android Chrome Do not get OnRenditionSwitched event, that fires when an adaptive bitrate stream starts and when the rendition currently being played changes.
    Connection Induced Rebuffering Ration (CIRR) Over reported All browsers, content is unreachable The player does not report an error when content is unreachable; instead it goes into continuous buffering.
    Ended Plays Over reported All browsers, content is unreachable The player does not report an error when content is unreachable; instead it goes into continuous buffering.
    Exits Before Video Start (EBVS) Over reported All browsers, content is unreachable Error event comes for ads instead of main content.
    Rebuffering Ratio (RR) Over reported All browsers, content is unreachable The player does not report an error when content is unreachable; instead it goes into continuous buffering.
    Video Start Failures (VSF) Under-reported All browsers, content is unreachable, pre-roll ads The error event comes for ads instead of main content.
    Video Playback Failures (VPF) Under-reported All browsers, content is unreachable The player does not report an error when content is unreachable; instead it goes into continuous buffering.
    Ad Start Failures (ASF) Under-reported Ad Unreachable Error event does not comes and main content starts playing.
    Ad Playback Failures (APF) Over-reported Main Content Unreachable, Pre-roll Ads playing Error event does not comes and main content starts playing.
    Metadata Name Impact Conditions Issue
    Device Manufacturer Not detected Desktop Browsers: - Windows 7 - Windows 10 - Linux The Conviva library auto-detects this information from the User Agent String and cannot infer this metadata for desktop browsers.
    Device Marketing Name Not detected Desktop Browsers: - Windows 7 - Windows 10 - Linux - Mac The Conviva library auto-detects this information from the User Agent String and cannot infer this metadata for desktop browsers.
    Device OS Version Not detected Desktop Browsers: - Windows 7 - Windows 10 - Linux The Conviva library auto-detects this information from the User Agent String and cannot infer this metadata for desktop browsers.

    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.

    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.