Skip to main content
Version: 25.03

Heatmaps - Views

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/o/heatmaps/views

Overview​

Returns the views of an app that were visited at least once in the selected period, with their visit count and scroll value. The output is a table: it can be paged, sorted and searched.

Authentication​

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

Permissions​

Requires Read permission on the heatmaps feature.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
app_idStringYesApp ID.
periodStringNoStandard Countly period value, for example 30days.
segmentStringNoSegment key to read segmented view data.
segmentValStringNoSegment value for segment.
iDisplayStartNumberNoIndex of the first row to return.
iDisplayLengthNumberNoNumber of rows to return. -1 or missing returns all rows.
iSortCol_0NumberNoColumn to sort by: 0 name, 1 scroll (scr), 2 visits (t). Without it, rows are sorted by visits, highest first.
sSortDir_0StringNoSort direction, asc or desc. Used together with iSortCol_0.
sSearchStringNoCase-insensitive text filter on the view name.
sEchoStringNoValue returned unchanged as sEcho.

Examples​

Read the most visited views​

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

Search views by name​

/o/heatmaps/views?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&period=30days&sSearch=home

Response​

Success Response​

{
"sEcho": "1",
"iTotalRecords": 2,
"iTotalDisplayRecords": 2,
"aaData": [
{
"_id": "65f0cbf8bca6b8e8fbf7f901",
"view": "/home",
"url": "https://example.com/home",
"display": "Home",
"t": 1520,
"scr": 62
}
]
}

Response Fields​

FieldTypeDescription
sEchoStringThe sEcho value from the request.
iTotalRecordsNumberTotal number of matching views.
iTotalDisplayRecordsNumberSame as iTotalRecords.
aaDataArrayOne entry per view.
aaData[].viewStringView name.
aaData[].urlStringView URL, when known.
aaData[].displayStringDisplay name, when set.
aaData[].tNumberTotal visits in the period.
aaData[].scrNumberScroll value for the period.

Error Responses​

  • 400
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • 401
{
"result": "User does not have right"
}

Behavior​

  • Only views with at least one visit in the period are returned.
  • Read-only. Nothing is modified.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication and permission checkReads the member and permissions.
countly.app_viewdata{sha1(segment+appId)}View metricsReads aggregated visit and scroll values.
countly.app_viewsmeta{appId}View namesReads view names, display names and URLs.