k-ux-analytics
OPC
Analytics library allows to send predefined events to Kaltura DTLK.
This library uses the following technologies and conventions:
Installation
This module is distributed via npm, which is bundled with node and should be installed as one of your project's dependencies.
npm i @kaltura-ott/tvpil-analytics
Usage
import { KDataLake, KUxAnalytics, KUxBaseEventData, UserLoginSuccessEventArgs } from '@kaltura-ott/tvpil-analytics';
const baseEventData: KUxBaseEventData = {
groupId: 1234,
userId: 2,
udid: 'UDID',
ks: 'user or anonymous ks',
};
KUxAnalytics.configure(
{
app: 'K1',
version: '1.0.0',
plugins: [new KDataLake({ endpointUrl: 'URL_TO_DTLK' })],
},
baseEventData,
);
const loginSuccess = new UserLoginSuccessEventArgs('someUserName');
KUxAnalytics.getInstance().send(loginSuccess);
KUxAnalytics.getInstance().send(loginSuccess, () => {
console.log('do this after track');
});
KUxAnalytics.getInstance().updateBaseData({ userId: 12 });
Analytics Errors
Playback errors
Code | Message |
---|
1000 | recordingId is mandatory when mediaType equals RECORDING |
1001 | epgId is mandatory when mediaType equals LIVE |
1002 | languageID missing for action LANG |
1003 | subtitleID missing for action SUB_CHANGE |
1004 | errorID missing for action CONCURRENCY_CN |
1005 | audioTrackID missing for action AUDIO |
Device action errors
Code | Message |
---|
2000 | initiatedBy param missing |
2001 | swVersion param missing |
2002 | custom param missing |
Configuration errors
Code | Message |
---|
5000 | endpointUrl missing in plugin config |
Available Events
All available events can be found here
Available Plugins
All supported plugins and its DMS configuration can be found here