# Analytics Options
If you already use NPAW's Youbora, you can replace the dedicated Youbora plugin with Unified Plugin, as it already includes it. To customize the Analytics options of our plugin, you can inject an AnalyticsOptions
object to it:
- JavaScript
- Java
- Kotlin
- Swift
let analyticsOptions = {
'content.isLive': false,
'content.title': 'Title of the content'
// More options ...
};
let unifiedPlugin = new UnifiedPlugin('yourAccountCode');
unifiedPlugin.setAnalyticsOptions(analyticsOptions);
2
3
4
5
6
7
8
# Codavel Panel options
Use the following code to set options and metadata in our Suite of apps:
- JavaScript
- Java
- Kotlin
- Swift
{
// ...
'enabled': true,
'username': 'userTest',
'content.transactionCode': 'transactionTest',
}
2
3
4
5
6
Parameters | Type | Description |
---|---|---|
enabled | boolean | This parameter indicates whether our Analytics app is enabled or not. If 'true', then it will be enabled. If 'false', then it will be disabled. |
username | string | This is the User ID value associated with your system. Leave it blank if not in use. This will help you easily identify your users within Codavel Panel Analytics. |
transactionCode | string | This is a specific capable to search for, or identify and view, all users available within our Analytics platform. This code can be configured in several ways: purchaseCode, sessionCode, etc. Typically, you should use a parameter the customer can relate to their content management system (CMS) or paid transactions. |
# Media Metadata
# Option example
- JavaScript
- Java
- Kotlin
{
// ...
'content.title': 'titleTest',
'content.program': 'programName',
'content.duration': durationTest,
'content.isLive': true,
'content.bitrate': 123456,
'content.rendition': 'myCustomRendition',
'content.resource': 'http://yourhost.com/yourmedia.m3u8',
'content.cdn': 'AKAMAI',
'content.streamingProtocol': 'HLS',
'content.cdnNode': 'nodeName',
'content.cdnType': 1
'content.saga': 'saga name',
'content.tvShow': 'tvShow name',
'content.season': 'season number',
'content.episodeTitle': 'title name',
'content.channel': 'channel name',
'content.id': 'id',
'content.imdbId': 'imdb id',
'content.gracenoteId': 'gracenote id',
'content.type': 'type name',
'content.genre': 'genre name',
'content.language': 'language name',
'content.subtitles': 'subtitles name',
'content.contractedResolution': 'contracted resolution',
'content.cost': 'cost number',
'content.price': 'price number',
'content.playbackType': 'playback type',
'content.drm': 'drm',
'content.encoding.videoCodec': 'video codec name',
'content.encoding.audioCodec': 'audio codec name',
'content.encoding.codecSettings': 'codec settings',
'content.encoding.codecProfile': 'codec profile',
'content.encoding.containerFormat': 'container format'
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Parameter description
Parameters | Type | Description |
---|---|---|
title | string | You must set this parameter to let users search and filter real time data. |
program | string | If you set this parameter, what you set will be displayed as Program on Codavel Panel. This can be changed multiple times during the view (e.g., user is watching a single TV channel, but the programs/TV shows keep changing). |
duration | integer | Media duration in seconds: This parameter is drawn from the player, but will be overwritten should the plugin be integrated. |
isLive | boolean | This parameter indicates whether a stream URL resource is a live stream or Video on Demand (VoD) content. Accordingly, if 'true' (@YES), then our Analytics app will treat that content as a Live stream. If 'false' (@NO), then it will treat that content as VoD. |
bitrate | integer | Bitrate of the content being reproduced. |
rendition | string | Tag of the video quality being reproduced. |
resource | string | Media URL: This must be set when integrating the plugin. |
cdn | string | The original CDN is automatically detected from the media resource host. But it can be overwritten with this parameter, if needed. Find the CDNs list here. You need to use the “code” string. |
streamingProtocol | string | Used to manually set the content's media streaming protocol. Options include: HDS (Adobe HDS), HLS (Apple HLS), MSS (Microsoft Smooth Streaming), DASH (MPEG-DASH), RTMP (Adobe RTMP), RTP, RTSP, MULTICAST, DVB, DVB-C, DVB-T, DVB-T2. |
cdnName | string | The original CDN host ID or name can be overwritten, if needed. |
cdnType | integer | ## TCP_HIT / Check the CDN Node Types definitions in this document. this - link is missing |
package | string | Filter your data by a specific package such as Warner Bros, Paramount, Disney, Netflix, HBO, etc. |
saga | string | Filter your data by a specific saga, known as a collection of related, successive films that share the same fictional universe, or are marketed as a series. Note, saga dimensions for VOD movies are equivalent to VOD TV shows. |
tvShow | string | Filter your data by the TV show that is being consumed. If the video content is not identified as a TV show, it will not be included in the dataset. |
season | string | Filter your data by a specific season or sequence of related series programs, such as first, second, or third season of a specific series. |
episodeTitle | string | Filter your data by the episode title. This field should be used for content that has this relevant field (eg. series instead of movies). |
channel | string | Filter your data by the channel being tuned into to view content. |
id | string | Filter your data by a specific content ID (internal content identifier code specifically set by each customer). |
imdbId | string | Filter your data by a specific IMBD ID. |
gracenoteId | string | Filter your data by a specific Gracenote ID. |
type | string | Filter your data by a specific content type such as trailer, main, extra, clip, preview. |
genre | string | Filter your data by a specific content genre such as romance, thriller, fantasy, among many others. |
language | string | Filter your data by the language a user sets when watching content. Codavel Panel may make a record of multiple values during the video view. This can be done by changing the value in the Options object. Please note that multiple values are displayed in Codavel Panel in the Single Video View Details screen of the Tracking Video section. For aggregated dashboards and in the filter picker, only the last value recorded before the JOINTIME event is taken into account. |
subtitles | string | Filter your data by the subtitle a user sets when watching content. Codavel Panel may make a record of multiple values during the video view. This can be done by changing the value in the Options object. Please note that multiple values are displayed in Codavel Panel in the Single Video View Details screen of the Tracking Video section. For aggregated dashboards and in the filter picker, only the last value recorded before the JOINTIME event is taken into account. |
contractedResolution | string | Filter your data by a specific package quality contracted, also known as commercialized resolution, with the objective to distinguish the consumption of customers with different resolution contracts (e.g., platform plans with access to SD, HD or UHD qualities). |
cost | double | Filter your data by the cost of the subscription that the user has signed up for. |
price | double | Filter your data by the price which the customer has paid to view a specific piece of content. This is only applicable when a user has made a transaction for this purchase. |
playbackType | string | Filter your data by the type of media, whether this is LIVE, VOD or both. |
drm | string | Filter your data by the Digital Rights Management technology being used to encrypt and protect ad content. |
videoCodec | string | Filter your data by the video codec used within the container format. |
audioCodec | string | Filter your data by the audio codec used within the container format. |
codecSettings | string | Filter by the different encoding settings the customer has set in the encoder. |
codecProfile | string | Codec profiles target specific classes of application. Filter your views by their codec profile to see content with specific requirements. |
container | Format|string | Filter your data by the container format of the content file. |
# CDN node types
CDN node type | Description |
---|---|
TCP_HIT | Object was fresh in cache and object from disk cache. |
TCP_MISS | Object was not in cache, server fetched object from the forward server. |
TCP_REFRESH_HIT | Object was stale in cache and was successfully refreshed with the origin on an If-Modified-Since request. |
TCP_REFRESH_MISS | Object was stale in cache and refresh obtained a new object from forward server in response to our IF-Modified-Since request. |
TCP_REFRESH_FAIL_HIT | Object was stale in cache and failed on refresh (couldn't reach origin) so the stale object was served. |
TCP_IMS_HIT | IF-Modified-Since request from client and object was fresh in cache and served. |
TCP_NEGATIVE_HIT | Object previously returned a "not found" (or any other negatively cacheable response) and that cached response was a hit for this new request. |
TCP_MEM_HIT | Object was on disk and in the memory cache. Server served it without hitting the disk. |
CDN NODE DETECTION
See this article on CDN Node Detection (opens new window) for further information.
# Network options
# Option example
{
'network.ip': '1.1.1.1',
'network.isp': 'ISPTest',
'network.connectionType': 'cable/dsl'
}
2
3
4
5
# Parameter description
Parameters | Type | Description |
---|---|---|
network.ip | string | The original IP is automatically detected from a third-party library. But use this parameter to overwrite it, if needed. Any desired value can be set. |
network.isp | string | The original ISP is automatically detected from a third-party library. But use this parameter to overwrite it, if required. Any desired value can be set. |
network.connectionType | string | The connection type, if needed. |
# Device options
# Option example
- JavaScript
- Java
- Kotlin
- Swift
{
// If you want full customised information of the device:
'device.id': 'myUniqueDeviceId',
'device.name': 'Android',
'device.model': 's8',
'device.brand': 'samsung',
'device.type': 'smartphone',
'device.osName': 'android',
'device.osVersion': '8.1',
'device.browserName': 'chrome',
'device.browserVersion': '72',
'device.browserType': 'mobile browser',
'device.browserEngine': 'v8',
'device.EDID': '123456' // As string or byte array
// Or if you want generic information
'device.code': 'xbox360' // Device will be detected as Xbox 360
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
ATTENTION
Both deviceName
and deviceCode
have mandatory formats that should match our libraries. If it doesn’t match, Unknown label will be assigned.
HIERARCHY
There is a hierarchy within device options, in which higher hierarchy will overwrite lower ones:
deviceCode
⤵️
deviceName
⤵️
device
(rest of objects)
# Code and name options
Choose from the codes (opens new window) for each “device code” and “device name” option. This is one approach.
All the other options are available in Android starting with 6.3.3, in C# starting with 6.0.7 and in JS starting with 6.4.14.
# Ad metadata
These parameters relate to ad information if ads have been enabled. Be sure to add them into the main script structure. Parameters are shown in the following JavaScript example:
# Option example
- JavaScript
- Java
- Kotlin
{
'ad.ignore': false,
'ad.blockerDetected': false,
'ad.campaign': 'campaign name',
'ad.creativeId': '12345',
'ad.provider': 'provider name',
'ad.resource': 'http://resource.url.com',
'ad.title': 'ad name',
'ad.expectedPattern': {
pre: [1],
mid: [1,1],
post: [2]
},
'ad.givenAds': 2,
'ad.breaksTime': [0, 25, 45, 60],
'ad.expectedBreaks': 5,
'ad.givenBreaks': 5,
'ad.metadata': {
custom_field: "Custom value"
},
'ad.customDimension.1': "custom dimension 1",
'ad.customDimension.2': "custom dimension 2"
// ...
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Parameter description
The table below provides a description of each of these parameters.
Parameters | Type | Description |
---|---|---|
ad.ignore | boolean | If 'true', our system blocks ad events and calculates join time ignoring ad time. 'False' by default. |
ad.customDimension | string | Fill this object with any relevant metadata information you want to store. Up to 10. |
ad.metadata | object | Item containing mixed extra information about ads like: request URL. This object may store any serializable key:value info. |
ad.campaign | string | String containing the name of the campaign. |
ad.creativeId | string | String containing the ID of the creative. |
ad.resource | string | String containing the ad resource. |
ad.title | string | String containing the ad title. |
ad.expectedPattern | object | Object with the position of the breaks expected. Arrays are the number of breaks, and the numbers in them, the number of ads for each break. |
ad.givenAds | int | Number of ads given by the ad server for this break. |
ad.breaksTime | int array | Array of ints for the time position of ad breaks |
ad.expectedBreaks | string | Number of breaks expected for the view. Not needed if expectedPattern is set. |
ad.givenBreaks | int | Number of breaks given by the ad server for the view. |
ad.provider | string | String containing the name of the provider of the ads. |
ad.blockerDetected | boolean | Null by default. View property to track the use of ad blockers. Set as true if adblocker was detected, set as false if no ad blocker was detected. Leave it if no ad blocker detection systems are available. |
# Other features
# Option example
- JavaScript
- Java
- Kotlin
{
'httpSecure': false,
'user.privacyProtocol': null,
'parse.cdnNode': true,
'parse.cdnNode.list': ['Akamai', 'Amazon', 'Cloudfront', 'Level3', 'Fastly', 'Highwinds', 'Telefonica', 'Edgecast', 'NosOtt', 'Balancer'],
'parse.cdnNameHeader': 'x-cdn-forward',
'parse.cdnNodeHeader': 'x-cdn-nodeid',
'parse.manifest': false,
'parse.manifest.auth': {'authorization': myToken },
'host': "lma.npaw.com",
'ad.ignore': false,
'obfuscateIp': false,
'userType': 'Normal',
'referer': 'http://www.url.com',
'background.enabled': true,
'background.settings': null,
'background.settings.android': 'stop',
'background.settings.iOS': 'stop',
'background.settings.desktop': null,
'background.settings.tv': 'stop',
'background.settings.playstation': 'stop',
'content.isLive.noSeek': false,
'content.isLive.noMonitor': false,
'app.name': 'myCustomApp',
'app.releaseVersion': '0.1-beta',
'waitForMetadata': false,
'pendingMetadata': ['title2','username'], // the name of the parameters in the request we are waiting for
'errors.fatal': ['123','errorcode'],
'errors.nonFatal': ['123','errorcode'],
'errors.ignore': ['123','errorcode']
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Parameter description
The table below describes each of these parameters:
Parameters | Type | Description |
---|---|---|
httpSecure | boolean | This Codavel Panel Analytics plugin sets whether all plugin output connections will be secure (https) or not. Accordingly, if: httpSecure = true, then the plugin will use https.; httpSecure = false, then the plugin will use http.; httpSecure = undefined, then the plugin will use default protocol (//). |
privacyProtocol | string | Privacy protocol to be used, empty by default. It is set specifically for companies that legally need to register if the users give consent to have personal data collected or not (due to CNIL, in France); otherwise, it is not necessary to be set. Possible values are "optin" (consent given) and "optout" (consent not given). |
host | string | Set an alternative domain name (CNAME) to configure Adblocker avoider. |
ad.ignore | boolean | If true, our system blocks ad events and calculates jointime ignoring ad time. False by default. |
background.enabled | boolean | If true, Codavel Panel will detect when the browser is going to background. True by default. |
background.settings | string | If not null, and background.enabled = true, will perform the action for all devices when the browser goes to the background. Options: null or ”, ‘stop’, ‘pause’. Null by default. |
background.settings.desktop | string | If background.enabled = true and background.settings = null, and the device is detected as desktop, will perform the action when the browser goes to the background. Options: null or ”, ‘stop’, ‘pause’. Null by default. |
background.settings.tv | string | If background.enabled = true and background.settings = null, and the device is detected as Smart TV, will perform the action when the browser goes to the background. Options: null or ”, ‘stop’, ‘pause’. Stop by default. |
obfuscateIp | boolean | If true, Codavel Panel will obfuscate the IP of the views. False by default. |
userType | string | Set the type of user. |
referer | string | Set the url of the site. In the Codavel Panel this is shown as "Content > Domain" dimension. Only the second- and top-level domain is stored, the rest of the URL is discarded. E.g. reporting "http://www.codavel.com/about/index.html" will result in "codavel.com" shown in the "Content > Domain" dimension. |
content.isLive.noSeek | boolean | If true, with live content /seek events will be disabled. |
content.isLive.noMonitor | boolean | If true, with live content playhead monitor will be disabled and buffer events will be reported only listening player events. |
forceInit | boolean | If true, init will be sent when fireStart is called(), start will be sent together with join time. False by default. |
app.name | string | Set the name of the appAvailable since 6.4.16. |
app.releaseVersion | string | Set the version number of the appAvailable since 6.4.16. |
parse.manifest | boolean | If true, the plugin will search inside the manifest to detect if the video is not hosted in the same CDN as the manifest, to show it in Codavel Panel. |
parse.manifest.auth | object | If parse.manifest enabled, if the requests to the CDN must include auth headers to get a response they must be set. Empty by default. |
waitForMetadata | boolean | Enabling this option enables the possibility of getting the /start request later on the view, making the flow go as follows: /init is sent when the player starts to load content, then when the playback starts /joinTime event will be sent, but with the difference of no /start request, instead it will be delayed until all the option keys from pendingMetadata are not null. |
pendingMetadata | list /array | Set option keys you want to wait for metadata, in order to work waitForMetadata must be set to true. |
errors.fatal | list /array | If it has elements on it, all the errors matching this code will fire the stop event to end the view. |
errors.nonFatal | list /array | If it has elements on it, all the errors matching this code will not fire a stop event to end the view. |
errors.ignore | list /array | If it has elements on it, all the errors matching this code will not be reported. |
parse.cdnNode | boolean | If true, plugin will request the manifest with specific debug headers for the available CDNs, to show the information obtained in Codavel Panel. This information is: CDN node name, CDN cache type (hit, miss) and CDN name. |
parse.cdnNode.list | list /array | List of the CDNs we want to check with the parse.cdnNode option, to avoid additional calls using CDN settings of unused CDNS. Available ones are: 'Akamai', 'Amazon', 'Cloudfront', 'Level3', 'Fastly', 'Highwinds', 'Telefonica', 'Edgecast', 'NosOtt'. There is a special case 'Balancer' that can be used to fetch on custom headers with the options parse.cdnNameHeader and parse.cdnNodeHeader. |
parse.cdnNameHeader | string | When using 'Balancer' on parse.cdnNode.list option it will use this as a header name where we expect to receive the name of the CDN, 'x-cdn-forward' by default. |
parse.cdnNodeHeader | string | When using 'Balancer' on parse.cdnNode.list option, it will use this as a header name where we expect to receive the ID of the CDN node. Disabled by default. |
# Custom dimensions
If additional parameters are required while filtering data in our analytics app, optional integrations or custom dimensions are available. There are 20 possible custom dimension set up within the device’s player when integrating the plugin.
Anything which requires filtration in real-time, and is of a relatively small value, is capable of becoming a custom dimension. For example, if a news website contains video in its several “sections” (e.g., sports, family, humor, kids, finance, etc.), a custom dimension titled “section” can be created with the above values. Please note, however, that such dimensions possess a limited number of well-controlled values.
Another possible custom dimension could collect demographic information for logged end users. Dividing an audience by gender and 5 age ranges, such as “male 24-35” or “female 60+”, the result will be a range of 20 possible values. This custom dimension could be titled “demographics”.
After setting up the video session metadata, up to 20 custom dimensions can be added, as shown below. Add these parameters to the main "script" structure.
All custom dimensions are type String.
# Option example
- JavaScript
- Java
- Kotlin
{
'content.customDimension.1': '1',
'content.customDimension.2': '2',
'content.customDimension.3': '3',
'content.customDimension.4': '4',
'content.customDimension.5': '5',
'content.customDimension.6': '6',
'content.customDimension.7': '7',
'content.customDimension.8': '8',
'content.customDimension.9': '9',
'content.customDimension.10': '10',
'content.customDimension.11': '11',
'content.customDimension.12': '12',
'content.customDimension.13': '13',
'content.customDimension.14': '14',
'content.customDimension.15': '15',
'content.customDimension.16': '16',
'content.customDimension.17': '17',
'content.customDimension.18': '18',
'content.customDimension.19': '19',
'content.customDimension.20': '20'
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Second option example
A second way to send custom dimensions, if you want to use more than 20, is to use the following customDimensions option. Please note that both formats are compatible:
- JavaScript
- Java
- Kotlin
{
'content.customDimensions': {
'key1': 'value1',
'key2': 'value2',
'key3': 'value3'
}
}
2
3
4
5
6
7
# Dynamic values
Find below the values—and their key names—that can be updated in real-time content, sent in pings.
Please note that by default everything apart from "metrics", "totalBytes" and "rendition" does not accept the dynamic values. This needs to be activated first. To do so, please get in touch at support@codavel.com.
metrics (contentMetrics)
totalBytes (contentTotalBytes)
rendition (contentRendition)
title (contentTitle)
title2 (program)
live (contentIsLive)
mediaDuration (contentDuration)
mediaResource (contentResource)
param1 (contentCustomDimension1)
param2 (contentCustomDimension2)
param3 (contentCustomDimension3)
param4 (contentCustomDimension4)
param5 (contentCustomDimension5)
param6 (contentCustomDimension6)
param7 (contentCustomDimension7)
param8 (contentCustomDimension8)
param9 (contentCustomDimension9)
param10 (contentCustomDimension10)
connectionType (networkConnectionType)
deviceCode (deviceCode)
ip (networkIP)
username (username)
cdn (contentCdn)
nodeHost (contentCdnNode)
nodeType (contentCdnType)
subtitles (contentSubtitles)
contentLanguage (contentLanguage)
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
NEED MORE INFO?
Get in touch with support@codavel.com.