Set Metadata - konstantin-shinkarenko/doc-sample-proj GitHub Wiki

Metadata is a very powerful way to enrich your analytics. It's applicable for either video or ad analytics. Provide metadata to analyse your data under different dimensions, e.g content, audience, device, workflow, player, versioning and so on.

Conviva categorizes metadata tags into three buckets:

  • Device metadata. May or may not be auto-detected by Conviva. For Android, Conviva auto-detects device metadata.
  • Pre-defined: common, Conviva-defined tags that describe video and ad content, versioning, workflows, etc. The full list of pre-defined tags is further down that page.
  • Custom Tags: tags that allows to extend metadata by your specific tags for either video or ad content, per business requirement.

Pre-defined and Custom metadata API syntax

Provide video content metadata

To set pre-defined or custom tags for video content, use the method setContentInfo():

ConvivaVideoAnalytics.setContentInfo (Map<String, Object> contentInfo);
  • contentInfo: map containing the key - value pairs of tags for video content.

Provide ad content metadata

To set pre-defined or custom tags for the Ads, use the method setAdInfo():

ConvivaAdAnalytics.setAdInfo (Map<String, Object> adInfo);`
  • adInfo: map containing the key - value pairs of tags for the Ads.

Pre-Defined Tags

The pre-defined tags are specified below along with description and use case. All the keys are defined as enums of ConvivaSdkConstants. Note that the same tag keys are applicable for both content and ads. An example usage of pre-defined tag:

Map<String, Object> contentInfo = new HashMap<String, Object>();
contentInfo.put(ConvivaSdkConstants.ASSET_NAME, "[channel_id] Live Channel Name");
... // set the values for the other keys as appropriate 
videoAnalytics.setContentInfo(contentInfo);

Map<String, Object> adInfo = new HashMap<String, Object>();
adInfo.put(ConvivaSdkConstants.ASSET_NAME, "[ad_id] My pre-roll ad asset");
... // set the values for the other keys as appropriate 
adAnalytics.setAdInfo(adInfo);
Key Type Description
STREAM_URL
required
string The manifest URL of video stream. If changes, has to be updated using the same method setContentInfo()
ASSET_NAME
required
string Unique name for each stream/video asset. Values are your choice, but a human-readable text prefixed with the unique video ID works best in most Conviva SDK's.
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:
Movie Pattern: [{contentId}] {Movie Title}
Sample Value: [12345] The ABC Movie
Episode Pattern: [{contentId}] {Show Title} - S:{Season Number}:E{Episode Number} - {Episode Title}
Sample Value: [67890] The XYZ Show - S3:E1 - The Pilot Episode
Live Stream Pattern: [{channelNumber}] {Chanel Name}
Sample Value: [10] PQRS Bay Area
IS_LIVE
required
string Denotes whether the content is video on-demand or a live stream. Affects the computation and availability of the Conviva metrics.

{Enum – ConvivaSdkConstants.StreamType.UNKNOWN/LIVE/VOD}
PLAYER_NAME
required
string A string value used to distinguish individual apps, players, locations, platforms, and/or deployments. 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 higher-level value to easily configure a filter to isolate the metrics of this Player
VIEWER_ID string Required for Viewers Module. A unique identifier to distinguish individual viewers or devices through Conviva's Viewers Module (purchase required). The identifier may be a user's unique username, an email address, a unique device identifier, or a generated GUID.
DEFAULT_RESOURCE string Default video server resource to report for the content. Use when the video server resource cannot be directly inferred from streamUrl.
Examples: EDGECONVIVA SDKT-1, AKAMAI-FREE, LEVEL3-PREMIUM...
DURATION integer Duration of the video content, in seconds.
ENCODED_FRAMERATE integer Encoded frame rate of the video in frames per second.

Custom Tags

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 ad content, by using appropriate 'analytics' object and it's corresponding method:

Map<String, Object> contentInfo = new HashMap<String, Object>();
contentInfo.put("key", "value");
videoAnalytics.setContentInfo(contentInfo);

Map<String, Object> adInfo = new HashMap<String, Object>();
adInfo.put("key", "value");
adAnalytics.setAdInfo(adInfo);

NEXT STEP

⚠️ **GitHub.com Fallback** ⚠️