Obter relatório de retenção no Mixpanel, por uma API

Retorna, para cada data de coorte, quantos usuários entraram na coorte (first) e quantos voltaram em cada intervalo depois dela (counts). Conta no limite da Query API de 60 consultas por hora.

Identificador
mixpanel_get_retention_report

A chamada

POST https://connect.reportei.com/api/tools/mixpanel_get_retention_report/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "project_id": 1,
    "from_date": "<from_date>",
    "to_date": "<to_date>"
  }
}

Seu sistema envia o id da conexão do cliente e os argumentos da tool. Os headers são os mesmos de toda a API do Connect: o token do seu produto e o token do cliente.

Parâmetros

As descrições dos parâmetros seguem a documentação oficial do app, em inglês.

ParâmetroTipoObrigatórioDescrição
project_idintegerSimId of the project, sent as a number: a key of results.projects in List projects, or the number after /project/ in the URL of Mixpanel.
workspace_idintegerNãoOnly for projects that use data views: the id of the global data view, a key of results.workspaces in List projects, sent as a number.
from_datestringSimFirst day, inclusive, as YYYY-MM-DD.
to_datestringSimLast day, inclusive, as YYYY-MM-DD.
retention_typestringNãobirth, the default, follows users from the first time they did born_event. compounded counts recurring returns.Valores: birth, compounded
born_eventstringNãoEvent that puts a user in a cohort, from List event names. Required when retention_type is birth.
eventstringNãoEvent counted as a return, from List event names. Omit it to count any event.
born_wherestringNãoExpression that filters the born events, for example properties["$os"] == "iOS".
wherestringNãoExpression that filters the events of the query, for example properties["$browser"] == "Chrome".
unitstringNãoUnit of the intervals. The default is day.Valores: day, week, month
intervalintegerNãoUnits in each interval. The default is 1, and with day it can be at most 90.
interval_countintegerNãoNumber of intervals returned, besides the 0th interval for returns in less than one interval. The default is 1.
unbounded_retentionbooleanNãotrue counts a user as retained in an interval when they came back in it or in any later one. The default is false.
onstringNãoProperty expression that segments the return event, for example properties["$browser"]. The property names come from List event properties.
limitintegerNãoMaximum number of segments when on is sent.

Conexões possíveis

O seu cliente conecta a conta do Mixpanel uma vez, por um dos modos abaixo. A mesma conexão serve para todas as tools do toolkit.

Usuário e senha

O cliente informa as credenciais do app numa tela do Connect, ou o seu sistema as envia por POST /api/customer-toolkits, sem tela.

A resposta

Em caso de sucesso, o Connect preserva o status e o corpo da resposta do app. Erros HTTP retornados pelo app usam o envelope {error, api_error}; falhas de autenticação ou validação podem ocorrer antes da execução. O header X-Toolkit-Execution-Id identifica a execução registrada, consultável em GET /api/tools/executions/{uuid}.

Pronta para agentes de IA

O input desta tool é um JSON Schema, disponível em GET /api/tools/mixpanel_get_retention_report. Ele vira a definição de tool do seu agente sem conversão.

Outras tools do Mixpanel

Ver as 12 tools

Toolkits da mesma categoria

Ver os 100 toolkits

Veja o Connect aplicado ao seu produto.

Teste por 15 dias sem cartão, ou mostre seu cenário ao nosso time.