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
Download the library and add dependencies.
Initialize Conviva using the CUSTOMER_KEY.
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.
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.
- 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:
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:
To install using the yarn package manager, use:
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:
|
||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Plugin and Player Inclusions |
The code sample shows how to include conviva-theplatform-plugin in the app and also the parameters to be passed.
Parameters to pass with tp:pluginConviva in the app:
IMPORTANT: No need to set Expected Errors Due to Dual Stack IPv4/v6 Network SupportWhen the Conviva SDK 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:
|
Initialize the video object |
Conviva Sdk relies on an instance of |
|---|---|
Initialize the ad object |
This is only applicable if your application has ads. Conviva Sdk relies on an instance of |
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 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 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 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). |
| 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: 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.
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
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".
|
||||||||||||||||||||||||||||||||||||||||||||
|
Update / Amend Ad Metadata |
Use the following method to set pre-defined and custom tags for ad content:
Please refer to the below example of setting both pre-defined and custom data using this method:
|
||||||||||||||||||||||||||||||||||||||||||||
|
Report Ad Metrics |
Report Ad-video metrics to
Refer to the list of metric keys to be implemented in the table below:
|
3. Report Events and Metadata
Report player metrics |
Metrics monitored by Conviva thePlatform plugin (if applicable):
|
|---|
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) |
|
|---|---|
|
On foregrounding |
|
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 |
|
|---|---|
| Use this API on dialogue dismiss |
|
Report Network Metrics
Metrics like connection type which is common for all the concurrent playback within one Analytics instance can be reported.
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:stringkey/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:booleanvalue 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:stringkey/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 ofstringtype.eventDetail: Optional argument of event details of the video player event ofobjecttype.
|
Report video-related events |
|
|---|
Report app-level events by the method Conviva.Analytics.reportAppEvent(/* string / eventType, / object */ eventDetail=):
eventType: Mandatory argument of event type of the app event ofstringtype.eventDetail: Optional argument of event details of the app event ofobjecttype.
|
Report app-level events |
|
|---|
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.