diff options
Diffstat (limited to 'doc/api/product_analytics.md')
-rw-r--r-- | doc/api/product_analytics.md | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/doc/api/product_analytics.md b/doc/api/product_analytics.md index 90df1090f62..c687acdb5db 100644 --- a/doc/api/product_analytics.md +++ b/doc/api/product_analytics.md @@ -25,42 +25,48 @@ 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. | +| 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.) | ### Request body The body of the load request must be a valid Cube query. +NOTE: +When measuring `TrackedEvents`, you must use `TrackedEvents.*` for `dimensions` and `timeDimensions`. The same rule applies when measuring `Sessions`. + +#### Tracked events example + ```json { "query": { "measures": [ - "Jitsu.count" + "TrackedEvents.count" ], "timeDimensions": [ { - "dimension": "Jitsu.utcTime", + "dimension": "TrackedEvents.utcTime", "dateRange": "This week" } ], "order": [ [ - "Jitsu.count", + "TrackedEvents.count", "desc" ], [ - "Jitsu.docPath", + "TrackedEvents.docPath", "desc" ], [ - "Jitsu.utcTime", + "TrackedEvents.utcTime", "asc" ] ], "dimensions": [ - "Jitsu.docPath" + "TrackedEvents.docPath" ], "limit": 23 }, @@ -68,6 +74,29 @@ The body of the load request must be a valid Cube query. } ``` +#### Sessions example + +```json +{ + "query": { + "measures": [ + "Sessions.count" + ], + "timeDimensions": [ + { + "dimension": "Sessions.startAt", + "granularity": "day" + } + ], + "order": { + "Sessions.startAt": "asc" + }, + "limit": 100 + }, + "queryType": "multi" +} +``` + ## Send metadata request to Cube Return Cube Metadata for the Analytics data. For example: @@ -79,3 +108,15 @@ 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. | + +## List a project's funnels + +List all funnels for a project. For example: + +```plaintext +GET /projects/:id/product_analytics/funnels +``` + +| Attribute | Type | Required | Description | +| --------- |------------------| -------- |--------------------------------------------------------------------| +| `id` | integer | yes | The ID of a project that the current user has the Developer role for. | |