Viewer Analytics
This endpoint retrieves viewer analytics data. This endpoint is use for deep insights on the analytics data.
- Type: objectdate
_range requiredThe timeframe to get the data for. Currently, we only support a maximum of 60 days between
start_atandend_at. - Type: array string[]metricsrequired
Get data for one or more
metricsin the same request. Please add any of these metrics.views,unique_views,impressions.completion_percent_by_views,playing_time,concurrent_users,widget_form_submitted,cta_clicks - Type: stringworkspace
_id requiredThe five to ten character unique identifier of the Gumlet workspace ID available on the Video Workspaces.
- Type: objectchart
_dimension Metrics result Group by selected dimension, You can select upto 3 dimensions to get nested category result. result will follow selection orders.
- Type: array object[]filters
Build segments of users using multiple filters on the data,
valueshould be an exact match - Type: string enumgroup
_by Data can be grouped by
daily,weeklyormonthly.values- daily
- weekly
- monthly
- application/json
- application/json
- application/json
import Gumlet from '@gumlet/nodejs-sdk';
const client = new Gumlet({
apiKey: process.env['API_KEY'], // defaults to the API_KEY env var
});
const dataAPI = await client.dataAPI.insightsChart({
metrics: [''],
workspace_id: '',
date_range: {
start_at: '2024-01-01',
end_at: '2024-01-01',
},
group_by: 'daily',
});
console.log(dataAPI);
{
"views": [
{
"x": 1647475200000,
"y": null,
"unit": "views"
},
{
"x": 1647561600000,
"y": null,
"unit": "views"
},
{
"x": 1647648000000,
"y": 6,
"unit": "views"
},
{
"x": 1647734400000,
"y": 24,
"unit": "views"
},
{
"x": 1647820800000,
"y": 33,
"unit": "views"
},
{
"x": 1647907200000,
"y": 16,
"unit": "views"
}
],
"unique_views": [
{
"x": 1647475200000,
"y": null,
"unit": "users"
},
{
"x": 1647561600000,
"y": null,
"unit": "users"
},
{
"x": 1647648000000,
"y": 1,
"unit": "users"
},
{
"x": 1647734400000,
"y": 1,
"unit": "users"
},
{
"x": 1647820800000,
"y": 1,
"unit": "users"
},
{
"x": 1647907200000,
"y": 1,
"unit": "users"
}
]
}
