Skip to main content
Version: 26.01

Heatmaps - Views Read

Endpoint​

/o/heatmaps/views

Overview​

Returns the views of an app that have at least one recorded click, with their click (t) and scrolling (scr) values for a period. The response is in the table format used by the dashboard.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires heatmaps Read permission.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringYesApp id.
periodStringNoPeriod to read, for example 30days, 7days or a JSON array of two timestamps. Defaults to 30days.
segmentStringNoView segment name. Defaults to no segment.
segmentValStringNoValue of the view segment.
iSortCol_0NumberNoIndex of the column to sort by: 0 for name, 1 for scr, 2 for t. Used together with sSortDir_0. Without both, rows are sorted by t in descending order.
sSortDir_0StringNoSort direction, asc or desc.
iDisplayStartNumberNoNumber of rows to skip.
iDisplayLengthNumberNoNumber of rows to return. When not set or -1, all rows are returned.
sSearchStringNoCase-insensitive search text matched against the view name.
sEchoStringNoValue returned unchanged as sEcho in the response.

Examples​

Read the views of an app​

/o/heatmaps/views?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&period=30days&iDisplayStart=0&iDisplayLength=10

Response​

Success Response​

{
"sEcho": "1",
"iTotalRecords": 1,
"iTotalDisplayRecords": 1,
"aaData": [
{
"_id": "6991c75b024cb89cdc04efd3",
"t": 120,
"scr": 45,
"view": "/home",
"url": "https://example.com/home",
"display": "/home"
}
]
}

Response Fields​

FieldTypeDescription
sEchoStringThe sEcho value from the request.
iTotalRecordsNumberTotal number of rows.
iTotalDisplayRecordsNumberTotal number of rows.
aaDataArrayRows, one per view.

Each row in aaData contains:

FieldTypeDescription
_idStringView id.
tNumberClick value for the period.
scrNumberScrolling value for the period.
viewStringView name, when known.
urlStringView URL, when known.
displayStringDisplay name of the view, when known.

Behavior​

  • Only views with t greater than 0 are returned.
  • When there is no data, aaData is an empty array.