Live Audience Analytics API

Live Audience Analytics API

Live Audience Analytics & APIs

Below are guidelines and API information for Live analytics for channels.

Live Analytics Workflow

  1. Register the device with the device registration service, and store the deviceId in localstorage and/or cookies on the device. So that next time user comes to the app there is no need to register it again, as well as its availability for the calls below.
  2. [OPTIONAL] If the response from Channels API -> getChannel has the field useSscs and the value is true then we also need to send an additional "idle" event every 9 mins (regardless of whether the video is being played or not. Make the first request in this interval before the player initializes.
  3. Make a "channel_start" call when the player starts playing the channel stream
  4. Repeatedly make "channel_time" calls at 1 minute intervals (while the video is playing, it should not do so if it is paused). Pass the uuid received in response of the initial "channel_start" call for each of these "channel_time" calls, as "parentEventId" field (Note in parameters below)

Device Registration

Endpoint: https://audience.icareus.com/api/devices/
Method: GET

Parameters:

Parameter Name
Requirement
Parameter Value
organizationId
Mandatory
ID of the organization/account

Note: For react native mobile applications define a "User-Agent" header for the request based on below plugin:

Response:
  1. {"status":"ok","deviceId":"6a9f3478-e948-3ad3-9bc2-2d84a8d7ac73"}
Remember to store this deviceId in cookies and/or local storage so that it is used for any subsequent calls or sessions, so the device registration should be done only once.

Live Analytics Events

Endpoint: https://audience.icareus.com/api/audience/
Method: GET

Parameters:

Parameter
Requirement
Value
Additional Notes
eventName
Mandatory
Acceptable values:
- channel_start
- channel_time

eventData
Mandatory
""
Empty string
serviceObject
Mandatory
{}
Empty object (as string)
organizationId
Mandatory
ID of the organization/account

suiteChannelId
Mandatory
ID of the channel being watched

deviceId
Mandatory
ID of the device

applicationTypeId
Mandatory
0

applicationId
Mandatory
0

path
Mandatory
/analytics/audience

externalEventData
Mandatory
{}
Empty object (as string)
parentEventId
Mandatory for "channel_time" events
UUID of parent event
Pass for every "channel_time" event, value should be the parent "channel_start" event's uuid.

Response:
  1. {"status":"ok","uuid":"3ba3b150-ab28-4da2-84bc-28fad1f14a50"}