Skip to main content
Version: 24.05

Heatmaps - Export

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/export

Overview​

Returns the database query that produces the heatmap views table, for use with the export endpoints. It returns the query, not the table data.

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). Sorted by view count, descending, when not set.
sSortDir_0StringNoasc for ascending; any other value sorts descending. Used together with iSortCol_0.

Examples​

Example: Get the export query​

curl "https://your-server.com/o/heatmaps/export?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&period=30days"

Response​

Success Response​

{
"db": "countly",
"pipeline": [],
"collection": "app_viewdata{hash}",
"projection": {
"_id": true,
"view": true,
"url": true,
"display": true,
"u": true,
"t": true,
"scr": true
}
}

Response Fields​

FieldTypeDescription
dbStringDatabase to run the query on, always countly.
pipelineArrayAggregation pipeline that builds the table.
collectionStringCollection to run the pipeline on.
projectionObjectFields included in the exported rows.

Behavior​

  • The exported rows contain the view (view, display, url), the unique count (u), the view count (t) and the scroll value (scr).
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.app_viewdata{sha1(segment+appId)}Aggregated view metricsNamed in the returned query; not read by this endpoint.