Data cube (Activities Analytics)
Query user activities as a data cube: metrics, dimensions, filters, and date ranges.
Your goal
Answer analytical questions about behaviour - active users, sessions, transactions - by combining metrics, dimensions, and filters rather than writing a query per question.
Expected outcome
Reports you can parameterise and reuse, including behind dashboards.
What a data cube is
Several API endpoints give access to data cubes. In each of them you create a report with a specific set of metrics and dimensions defined for that cube.
Activities analytics
Information on UserActivity.
Collection volumes
The number of indexed objects at given times. See Monitor collection volume.
Events ingestion monitoring
Events reaching each pipeline step. See Monitor data ingestion.
Resources usage
Query cost and ingested volume. See Monitor resource usage.
They all take the same request shape, which is why learning one teaches you the others.
Activities analytics
This API gives programmatic access to user activities as a data cube: metrics, with dimensions, filters, and date ranges - leveraging the activities analytics part of the multi-model database.
POST https://api.mediarithmics.com/v1/datamarts/:datamartId/user_activities_analyticsQuestions it answers
The pattern is always the same: a metric, optional dimensions to group by, and optional filters.
Number of active users
users
-
-
Number of active users per channel per day
users
channel_id, date_yyyymmdd
-
Sessions per day for users who had an AD_VIEW activity on campaign 666
sessions
date_yyyymmdd
activity_type = AD_VIEW, origin_campaign_id = 666
Days with more than 200k transactions on a channel
number_of_transactions
date_yyyymmdd
channel_id = 666, plus a filter on the calculated metric to keep days above 200k
That last row is worth noting: filters apply both to dimensions before the metric is calculated, and to the calculated metric itself.
The request
metrics
The metrics to retrieve.
dimensions
The dimensions to group metrics by.
dimension_filter_clauses
Filters applied on dimensions before the metric is calculated.
date_ranges
The periods to analyse, each with a start_date and an end_date.
The response is a report view with columns_headers and rows.
Where the data comes from
The cube reads the duplicated and optimised copy of your activities that the platform maintains for performance analytics - and that copy is only built for predefined events.
Where it is used
Directly, through the API, for reporting.
Behind custom dashboards.
In the built-in dashboards and funnel analytics.
Related pages
Last updated
Was this helpful?