doc/api/product_analytics.md
{{< details >}}
{{< /details >}}
{{< history >}}
cube_api_proxy. Disabled by default.cube_api_proxy removed and replaced with product_analytics_internal_preview in GitLab 15.10.product_analytics_internal_preview replaced with product_analytics_dashboards in GitLab 15.11.product_analytics_dashboards enabled by default in GitLab 16.11.product_analytics_dashboards removed in GitLab 17.1.product_analytics_features.{{< /history >}}
[!flag] The availability of this feature is controlled by a feature flag. For more information, see the history. This feature is not ready for production use.
Use this API to track user behavior and application usage.
[!note] Make sure to define the
cube_api_base_urlandcube_api_keyapplication settings first using the API.
Creates a query request to the Cube API and generates an access token.
POST /projects/:id/product_analytics/request/load
POST /projects/:id/product_analytics/request/dry-run
| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The ID of a project that the current user has read access to. |
include_token | boolean | no | Whether to include the access token in the response. (Only required for funnel generation.) |
The body of the load request must be a valid Cube query.
[!note] When measuring
TrackedEvents, you must useTrackedEvents.*fordimensionsandtimeDimensions. The same rule applies when measuringSessions.
{
"query": {
"measures": [
"TrackedEvents.count"
],
"timeDimensions": [
{
"dimension": "TrackedEvents.utcTime",
"dateRange": "This week"
}
],
"order": [
[
"TrackedEvents.count",
"desc"
],
[
"TrackedEvents.docPath",
"desc"
],
[
"TrackedEvents.utcTime",
"asc"
]
],
"dimensions": [
"TrackedEvents.docPath"
],
"limit": 23
},
"queryType": "multi"
}
{
"query": {
"measures": [
"Sessions.count"
],
"timeDimensions": [
{
"dimension": "Sessions.startAt",
"granularity": "day"
}
],
"order": {
"Sessions.startAt": "asc"
},
"limit": 100
},
"queryType": "multi"
}
Retrieves Cube metadata for analytics data.
GET /projects/:id/product_analytics/request/meta
| Attribute | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The ID of a project that the current user has read access to. |