Client reporting
Summary
Client reporting covers any type of data sent from the client device to the server for reporting purposes. This can include the following:
User activity, for example:
- Watched a VOD content.
- Watched a channel for X minutes.
- Searched for keyword X.
- Recorded a content item.
- Created a series recording.
Error reporting, for example:
- Playback failed.
- Application failed to properly load.
- External content failed to download.
Session metrics, for example:
- Signon time.
- Uptime.
- Software version.
- Session length.
The OpenTV Platform does not enforce any specific reporting to be used. It must be agreed when defining the solution architecture what information should be supplied by the client application (and how often), and how it should be reported to the service provider. The OpenTV Platform's role is to simply collect the data sent to it in a format that is easily reported.
Two services exist in the OpenTV Platform that have somewhat overlapping responsibilities. The SDP's Content Consumption service enables a client to report actions associated with content consumption. For example, content playback attempts, success and failure. This can then be reported by the SDP to the service provider via a CSV report.
The Content Discovery Gateway (acting as a proxy to the User Activity Vault) can be used to report any client actions. Currently, the CDG supports integration with recommendation engines so that consumption activity can be reported to the recommendation engine to improve the recommendations.
Data models
Data models returned in response to activity requests
The data models that are returned in response to activity requests from CDG are JSON objects as follow:
Data models used in user activity requests
The data models used in user activity requests to CDG are JSON objects as detailed below:
Use cases
Report account activity to CDG
Account activities are reported to CDG by submitting a HTTP POST request to an appropriate URL using the following parameters:
When reporting at account level the account number and activity type are submitted as part of the URL.
In the example below, the client is reporting that account ACC1234 has performed activity WATCH on VOD content LYS2468:
POST http://contentdiscovery/v1/useractivity/WATCH/account/ACC1234
Content-Type: application/json
{"dataType":"vod","deviceType":"SetTopBox","contentId":"LYS2468","timestamp":"2014-07-25T12:20:02.000Z"}
Report user activity to CDG
User activities are reported to CDG by submitting a HTTP POST request to an appropriate URL using the following parameters:
When reporting at user level the account number, user ID, and activity type are submitted as part of the URL.
In the example below, the client is reporting that user USR9876 belonging to account ACC1234 has performed activity WATCH on VOD content LYS2468:
POST http://contentdiscovery/v1/useractivity/WATCH/account/ACC1234/user/USR9876
Content-Type: application/json
{"dataType":"vod","deviceType":"SetTopBox","contentId":"LYS2468","timestamp":"2014-07-25T12:20:02.000Z"}
Retrieve account activity from CDG
Account activities are requested from CDG by submitting a HTTP GET request to an appropriate URL using the following parameters:
When querying at account level the account number and activity type are submitted as part of the URL.
In the example below, the client is requesting all WATCH activities recorded for account ACC1234:
GET http://contentdiscovery/v1/useractivity/WATCH/account/ACC1234
Response example:
{"activities":[
{"id":"6fb9f0e0-967e-11e4-8196-f7b9520b3e0c","accountId":"234521354","userId":"USR2468","name":"WATCH","key":"LYS2345","value":"234521354","timestamp":"2015-01-07T15:04:11Z","metadata":{"Title":"Spinal Tap"}},
{"id":"ce88bf90-9686-11e4-8196-f7b9520b3e0c","accountId":"234521354","userId":"USR2468","name":"WATCH","key":"LYS2346","value":"234521354","timestamp":"2015-01-07T16:04:06Z","metadata":{"Title":"Goodfellas"}},
{"id":"f27f2380-9686-11e4-8196-f7b9520b3e0c","accountId":"234521354","userId":"USR1234","name":"WATCH","key":"LYS2347","value":"234521354","timestamp":"2015-01-07T16:05:06Z","metadata":{"Title":"Star Wars"}}
],
"totalRecords":3}
Retrieve user activity from CDG
User activities are requested from CDG by submitting a HTTP GET request to an appropriate URL using the following parameters:
When querying at user level the account number, user ID, and activity type are submitted as part of the URL.
In the example below, the client is requesting all WATCH activities recorded for user USR2468 that belongs to account ACC1234:
GET http://contentdiscovery/v1/useractivity/WATCH/account/ACC1234/user/USR2468
Response example:
{"activities":[
{"id":"6fb9f0e0-967e-11e4-8196-f7b9520b3e0c","accountId":"234521354","userId":"USR2468","name":"WATCH","key":"LYS2345","value":"234521354","timestamp":"2015-01-07T15:04:11Z","metadata":{"Title":"Spinal Tap"}},
{"id":"ce88bf90-9686-11e4-8196-f7b9520b3e0c","accountId":"234521354","userId":"USR2468","name":"WATCH","key":"LYS2346","value":"234521354","timestamp":"2015-01-07T16:04:06Z","metadata":{"Title":"Goodfellas"}}
],
"totalRecords":2}
Delete account activity from CDG
To delete account activity an HTTP DELETE request must be submitted to an appropriate URL using the following parameters:
When querying at account level the account number is submitted as part of the URL.
In the example below the client is requesting that all activities recorded by account ACC1234 be deleted:
DELETE http://contentdiscovery/v1/useractivity/account/ACC1234?deleteActivityRequest={"deviceType":"MediaPLayer"}