Show Menu
TOPICS×

Get Concurrent Viewers JSON report data with Analytics 2.0 APIs

You can obtain concurrent viewers report data using the
Analytics 2.0 APIs
.
  1. Filter the data using any segment that is built on the UI. To filter by a specific Content ID, create a new segment.
  2. Set the
    elements
    ->
    id
    in the request body to
    metrics/concurrent_viewers_visitors
    .
  3. Request a sufficient amount of data.
    • The data range you specify in the report gathers all concurrent viewer data
      at the time the video session ended.
      You must account for sessions that start on one day and end after midnight which is the next day.
    • Request one more day of data to your intended period in your request, but in your analysis
      use only the intended data.
A sample request payload for one day of data would look like the following sample. The request is done for 2 consecutive days but in reporting you use only the first day.

Sample Request

{ "rsid": "[YOUR_RSID]", "locale": "en_US", "dimension": "variables/daterangeminute", "globalFilters": [ { "dateRange": "2020-09-02T00:00/2020-09-03T00:00", "type": "dateRange" } ], "metricContainer": { "metrics": [ { "columnId": "column1", "id": "metrics/concurrent_viewers_visitors" } ] }, "settings": { "dimensionSort": "asc", "limit": "2000", "page": 0 } }

Sample Response

{ "totalPages":1, "firstPage":true, "lastPage":true, "numberOfElements":1440, "number":0, "totalElements":1440, "columns":{ "dimension":{ "id":"variables/daterangeminute", "type":"time" }, "columnIds":[ "column1" ] }, "rows":[ { "itemId":"12008020000", "value":"00:00 2020-09-02", "data":[ 123.0 ] }, { "itemId":"12008020001", "value":"00:01 2020-09-02", "data":[ 143.0 ] }, { "itemId":"12008020002", "value":"00:02 2020-09-02", "data":[ 167.0 ] }, ... { "itemId":"12008022359", "value":"23:59 2020-09-02", "data":[ 768.0 ] } ], "summaryData":{ "filteredTotals":[ 17124.0 ], "totals":[ 18453.0 ] } }