query_retention_report
Analyze user retention and engagement over time by extracting data from Retention reports. Measure product stickiness and evaluate retention rates after specific user actions using customizable parameters.
Instructions
Get data from your Retention reports. Useful for analyzing user engagement over time, measuring product stickiness, and understanding how well your product retains users after specific actions. Only use params interval or unit, not both.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
born_event | No | The first event a user must do to be counted in a birth retention cohort, required if retention_type is 'birth'. Can use $mp_web_page_view as the born_event for general cases. | |
born_where | No | An expression to filter born_events by based on the grammar: <expression> ::= 'properties["' <property> '"]' | <expression> <binary op> <expression> | <unary op> <expression> | <math op> '(' <expression> ')' | <string literal> <binary op> ::= '+' | '-' | '*' | '/' | '%' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'and' | 'or' | <unary op> ::= '-' | 'not' | |
event | No | The event to generate returning counts for. If not specified, looks across all events | |
from_date | Yes | The date in yyyy-mm-dd format to begin querying from (inclusive) | |
interval | No | The number of units per individual bucketed interval. Default is 1. DO NOT USE IF ALREADY PROVIDING UNIT. | |
interval_count | No | The number of individual buckets/intervals to return. Default is 1. DO NOT USE IF ALREADY PROVIDING UNIT. | |
limit | No | Return the top limit segmentation values. Only applies when 'on' is specified | |
on | No | The property expression to segment the second event on | |
project_id | No | The Mixpanel project ID. Optional since it has a default. | |
retention_type | No | Type of retention: 'birth' (first time) or 'compounded' (recurring). Defaults to 'birth' | |
return_where | No | An expression to filter return events by based on the grammar: <expression> ::= 'properties["' <property> '"]' | <expression> <binary op> <expression> | <unary op> <expression> | <math op> '(' <expression> ')' | <string literal> <binary op> ::= '+' | '-' | '*' | '/' | '%' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'and' | 'or' | <unary op> ::= '-' | 'not' | |
to_date | Yes | The date in yyyy-mm-dd format to query to (inclusive) | |
unit | No | The interval unit: 'day' (eg use if asked for D7 or D30), 'week' (eg use if asked for W12), or 'month' (eg use if asked for M6). Default is 'day'. DO NOT USE IF ALREADY PROVIDING INTERVAL. | |
workspace_id | No | The ID of the workspace if applicable |