Skip to main content
Version: 24.05

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 a table of the views that were visited at least once in the period, with their view count and scroll value.

Authentication​

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

Permissions​

  • Requires Read permission for the Heatmaps feature (heatmaps) in the target app.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesID of the app.
periodStringNoPeriod of the data, for example 30days or a date range.
segmentStringNoView segment to read the data for.
segmentValStringNoValue of segment.
iSortCol_0NumberNoColumn to sort by: 0 view name, 1 scroll value (scr), 2 view count (t). Sorted by view count, descending, when not set.
sSortDir_0StringNoasc for ascending; any other value sorts descending. Used together with iSortCol_0.
iDisplayStartNumberNoNumber of rows to skip.
iDisplayLengthNumberNoNumber of rows to return. -1 or not set returns all rows.
sSearchStringNoOnly return views whose name matches this text (case-insensitive).
sEchoStringNoValue echoed back in the response, for DataTables paging.

Examples​

Example: List views​

curl "https://your-server.com/o/heatmaps/views?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&period=30days&iDisplayStart=0&iDisplayLength=10"

Response​

Success Response​

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

Response Fields​

FieldTypeDescription
sEchoStringThe sEcho value of the request.
iTotalRecordsNumberTotal number of rows.
iTotalDisplayRecordsNumberSame as iTotalRecords.
aaDataArrayThe rows of the requested page.
aaData[]._idStringID of the view.
aaData[].viewStringName of the view.
aaData[].displayStringDisplay name of the view.
aaData[].urlStringURL of the view.
aaData[].tNumberView count in the period.
aaData[].scrNumberScroll value of the view in the period.

Behavior​

  • Only views with a view count above zero are returned.
  • When no view data exists, aaData is an empty array.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.app_viewdata{sha1(segment+appId)}Aggregated view metricsReads the view counts and scroll values.
countly.app_viewsmeta{appId}View metadataReads the view name, display name and URL.